Hi Folks!
I have what I guess is a pretty straightforward question but my limited knowledge of macros means that I need some help!
I am trying to increment a number in a cell by one each time a page is printed. So for example I want 10 pages, I get the same sheet, but with 1 on the first, 2 on the second and so on.
I have nicked / borrowed / plagiarised a bit of code that will do this fine, but only if the number I start with is 1. I really need the number to be selectable by the operator (the current range of numbers is 13863 for example and each print wants to increment the number from there).
The code I have goes like this:
Sub PrintCopies_ActiveSheet()
Dim CopiesCount As Long
Dim CopieNumber As Long
CopiesCount = Application.InputBox("How many Sheets do you want?", Type:=1)
CopieStart = Application.InputBox("What number do you want to start from ?", Type:=1)
For CopieNumber = 1 To CopiesCount
With ActiveSheet
'number in cell E30 (prints "n")
.Range("E30").Value = CopieNumber
'number in cell E30 (prints "n of z")
'.Range("E30").Value = CopieNumber & " of " & CopiesCount
'number in the footer (prints "n of z")
'.PageSetup.LeftFooter = CopieNumber & " of " & CopiesCount
'Print the sheet
.PrintOut
End With
Next CopieNumber
End Sub
I have added the line "CopieStart = Application.InputBox("What number do you want to start from ?", Type:=1)" and this does prompt me to enter the starting number.
I now need to have the code use this starting number as the first of the incremental series.
Does that make sense
I hope so
.
Any help very gratefully received.
Cheers,
Fungijus.
Bookmarks