Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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) -- Regards Frank Kabel Frankfurt, Germany EddySon wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "Frank Kabel" wrote in message ... 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) -- Regards Frank Kabel Frankfurt, Germany EddySon wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Macro Needed | Excel Discussion (Misc queries) | |||
Macro needed for assigning serial numbers | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Save as Macro in excel - Help needed!! | Excel Discussion (Misc queries) | |||
help needed with excel macro | Excel Programming |