ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I print the same sheet multiple times with increasing page. (https://www.excelbanter.com/excel-discussion-misc-queries/19798-how-do-i-print-same-sheet-multiple-times-increasing-page.html)

C&S

How do I print the same sheet multiple times with increasing page.
 
How do I print the same sheet multiple times with increasing page numbers?

Peter Rooney

C&S,

You could try something like this:

Sub MultiPrint()
Dim PrintCount As Integer
For PrintCount = 1 To 5
ActiveSheet.PageSetup.CenterFooter = "Page " & PrintCount
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Next
End Sub

To increase the number of prints, simply change the "5" to whatever value
you require

Hope this helps

Pete


"C&S" wrote:

How do I print the same sheet multiple times with increasing page numbers?


C&S

Thank you very much! But where do you type this? Is it a script file? If so,
how do you get excel to run it?

"Peter Rooney" wrote:

C&S,

You could try something like this:

Sub MultiPrint()
Dim PrintCount As Integer
For PrintCount = 1 To 5
ActiveSheet.PageSetup.CenterFooter = "Page " & PrintCount
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Next
End Sub

To increase the number of prints, simply change the "5" to whatever value
you require

Hope this helps

Pete


"C&S" wrote:

How do I print the same sheet multiple times with increasing page numbers?


C&S

How do you let the program know that you want to print multiple copies. It
is only printing one. I got it into the visual basic, but the print preview
only shows one copy. Thanks.

Peter Rooney

Hi, C&S!

Have you copied the code into a Visual Basic module?

From your worksheet, press Alt+F11

Click "Insert" and "Module" from the menu

Paste the code into the module sheet that is inserted

Press Alt+F11 again to go back to your worksheet

Click on "Tools" "Macro" "Macros" from the menu

Double click "Multiprint" (the macro name from) box that is displayed.

You can only see one copy in Print Preview because it doesn't know about the
code.

Sub MultiPrint()
Dim PrintCount As Integer
For PrintCount = 1 To 5
ActiveSheet.PageSetup.CenterFooter = "Page " & PrintCount
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Next
End Sub

When you run the macro in the manner shown above, you'll get 5 prints, each
one with an incrementing page number. If you change "1 to 5" in line 3 to,
dor example, "1 to 10", you'll get 10 copies.

This is a simple Visual Basic programming loop that counts from one number
to another number and places the value of the count in the footer string.

Hope this helps, and that it encourages you to try some VBA of your own! Try
recording code as you do things, and going into the module to see how code
gets built up!

Regards

Pete





Sub MultiPrint()
Dim PrintCount As Integer
For PrintCount = 1 To 5
ActiveSheet.PageSetup.CenterFooter = "Page " & PrintCount
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Next
End Sub

"C&S" wrote:

How do you let the program know that you want to print multiple copies. It
is only printing one. I got it into the visual basic, but the print preview
only shows one copy. Thanks.



All times are GMT +1. The time now is 05:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com