hello people,
i'm currently figuring out a macro that prints 199 pages of the same worksheet, a template for a cover page of a vehicle maintenance record and i need the 199 pages to be printed with a different ID defined in a column of 199 cells, each with a unique number not in a sequential arrangement(i.e. 1001, 1002, 1003, ... x+1, x+1+1, ...etc)
Instead what I need to do is have the printed pages print from a series of data in a column as such:
1) 123
2) 369
3) 246
4) 135
5) 999
...
10) ###
etc and so forth till 199).
I've seen increments of +1 done fairly simply but i do not know how to adjust the macro to pring from a list of numbers.
I've done several google searches but I only found this as the nearest match to whhat I need.
Sub Print2000()
Dim i
setRng = InputBox("Enter the starting number...", "First Number")
If setRng = "" Then
Exit Sub
ElseIf Not IsNumeric(setRng) Then
MsgBox "Entry must be numeric!", vbCritical, "Invalid Entry"
Exit Sub
End
If dblChk = MsgBox("Are you sure you wish to print 2000 pages?", _
vbYesNo, "Think Twice - Act Once!")
Select Case
dblChk Case Is =
vbYes Range("A1").Value = ""
Range("A1").NumberFormat = "@"
For i = 1 To 2000
If setRng < 10
Then pfx = "000"
ElseIf setRng < 100 Then
pfx = "00"
ElseIf setRng < 1000Then
pfx = "0"
Else pfx = ""
End If
Range("A1").Value =pfx & setRng
ActiveSheet.PrintOut
setRng = setRng + 1
Next
Case Is = vbNo
End Select
End Sub
This macro was for printing 2000 pages with a number set entered into cell A1.
This is my first time using VBA macros and I'm very unsure of the terms defined in macro.
I think this might be an easy one for me to learn, i hope someone could guide me on what to do.
Moderator Note:
Pls use code tags around your code next time as per forum rules.
Bookmarks