Arkadaşlar siteden bu kodu buldum. Amacı her baskıdan onra 1 değer arttırıp yazdırması. Ben bunu koli üstü etiket yazdırmada kullanıyorum. Yani 100 baskı yapıcaksam girdiğim hücre değerini 1 er adet arttırararak yazdırıyor. Yani 1-2-3 ..100 e kadar koli etiketi. Ama ben her baskıyı 2 adet yazdırsın istiyorum. Yani 1. koliden 2 adet 2 koliden 2 adet gibi kaç koli varsa. Bu konuda bilgim yetersiz nasıl yapabilirim.
Teşekkürler.
Sub IncrementPrint()
'updateby Extendoffice 20160530
Dim xCount As Variant
Dim xScreen As Boolean
Dim I As Long
On Error Resume Next
LInput:
xCount = Application.InputBox("Please enter the number of copies you want to print:", "Kutools for Excel")
If TypeName(xCount) = "Boolean" Then Exit Sub
If (xCount = "") Or (Not IsNumeric(xCount)) Or (xCount < 1) Then
MsgBox "error entered, please enter again", vbInformation, "Kutools for Excel"
GoTo LInput
Else
xScreen = Application.ScreenUpdating
Application.ScreenUpdating = False
For I = 1 To xCount
ActiveSheet.Range("V1").Value = " " & I
ActiveSheet.PrintOut
Next
ActiveSheet.Range("A1").ClearContents
Application.ScreenUpdating = xScreen
End If
End Sub
Teşekkürler.
Sub IncrementPrint()
'updateby Extendoffice 20160530
Dim xCount As Variant
Dim xScreen As Boolean
Dim I As Long
On Error Resume Next
LInput:
xCount = Application.InputBox("Please enter the number of copies you want to print:", "Kutools for Excel")
If TypeName(xCount) = "Boolean" Then Exit Sub
If (xCount = "") Or (Not IsNumeric(xCount)) Or (xCount < 1) Then
MsgBox "error entered, please enter again", vbInformation, "Kutools for Excel"
GoTo LInput
Else
xScreen = Application.ScreenUpdating
Application.ScreenUpdating = False
For I = 1 To xCount
ActiveSheet.Range("V1").Value = " " & I
ActiveSheet.PrintOut
Next
ActiveSheet.Range("A1").ClearContents
Application.ScreenUpdating = xScreen
End If
End Sub