I am working on an excel workbook. I want to and a command button to the first sheet so that it will print 2 copies of that sheet. Where can i find some VBA code to help me out. Thank you.
I am working on an excel workbook. I want to and a command button to the first sheet so that it will print 2 copies of that sheet. Where can i find some VBA code to help me out. Thank you.

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
Welcome to Woody's Lounge!
You can often get a good idea of the code you need by recording a macro of the action(s) that you want to automate.
- Make sure that you show the Developer tab in the Ribbon.
- In the Code group, click Record Macro
- Specify a name, for example Print2Copies, then click OK.
- Perform the actions that you want to record.
- Click the Stop Recording button when you're done.
- Click Macros
- Select the name that you gave the macro.
- Click Edit. You'll see the code of the recorded macro.
- The line that prints two copies in the macro that I recorded is:
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True
- Click in the word PrintOut and press F1 to get help about this keyword.
Note: an alternative instruction is
ActiveSheet.PrintOut Copies:=2
Welcome to the lounge!
The simplest way to do this is to record a macro of the normal printing procedure. You can then assign that macro to the button.
It will look something like this:
Application.ActivePrinter = "YourPrinter'sName"
ActiveWindow.SelectedSheets.PrintOut Copies:=2, ActivePrinter:= _
"YourPrinter'sName", Collate:=True
Thank you for the help. It has been some time since i have used VBA codes. This should get my project completed. Thank you.