Printing numbers in Excel. Macro needed.

  • Thread starter Thread starter EddySon
  • Start date Start date
E

EddySon

I would like to use a macro in Excel to print a number in the top
right hand corner onto blank sheets of A4 paper.


In Cell M1 I would like to have a text string e.g. Order Number
In Cell M2 have the start number
In Cell M3 have the number of copies before the number increments (e.g.
print 4 sheets with 100 then increment to 101
and print another 4 sheets etc.)
In Cell M4 have the total number of "batches" to print. e.g. 10 ( to give 10
* the value in M3)
All help appreciated
Thanks Ted
 
Hi
try the following (not fully tested):
Sub print_multiple()
Dim copy_count As Integer
Dim header_txt As String
Dim start_number As Long
Dim batches As Integer
Dim i As Integer

copy_count = Range("M3").Value
header_txt = Range("M1").Value & ": "
start_number = Range("M2").Value
batches = Range("M4").Value

For i = 1 To batches
With ActiveSheet
.PageSetup.RightHeader = header_txt & start_number
.PrintOut Copies:=copy_count
End With
start_number = start_number + 1
Next i
End Sub


you may have to set the print area before invoking this macro (to
prevent printing cells M1:M4)
 
Hi Frank ....

It does exactly what I require. I really do appreciate your
help. You are right I added the print range code to get it to work
correctly.
This is certainly one for the macro archive.
Thanks agian.
Ted
 
Back
Top