The following code is simple in theory. I am trying to print a number of sheets, iterating a number from [some start] to [some finish]. Instead of print say 1-10, it will print a a "001" followed by a 9x "002"s. I can't really figure it out, clearly there is something I don't understand about how some of these functions work.
Sub CustomPrint()
Dim lStart As Long, lEnd As Long
Dim lPrint As Long
lStart = Cells(2, "A").Value
lEnd = Cells(4, "A").Value
For lPrint = lStart To lEnd
If lPrint > 99 Then
[A6] = CStr(lPrint)
ElseIf lPrint > 9 Then
[A6] = "0" & CStr(lPrint)
Else
[A6] = "00" & CStr(lPrint)
End If
Sheets("Traveler").PrintOut
Next lPrint
End Sub
Bookmarks