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.
|