Printing

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I work like to know how to set up the print function so I
can print multiple worksheets in the same wookbook by just
clicking the print button.
 
Hi Tom

Select the Sheets and print
Don't forget to ungroup the sheets

Or use VBA

ActiveWorkbook.PrintOut
'the whole workbook

Worksheets.PrintOut
'all worksheets

Sheets.PrintOut
'all sheets

Sheets(Array("Sheet1", "Sheet3")).PrintOut
'all sheets in the array

ActiveWindow.SelectedSheets.PrintOut
'print all selected sheets

ActiveSheet.PrintOut
'only the activesheet

Sheets("Sheet1").PrintOut
'only "Sheet1"
 
Ron,

I'm not the OP, but I would like to know how and where I can use the VBA.
Do I need to use it in a macro, or maybe use a button on a worksheet or
what?

Thanks

Jim Orson
 
Hi Jim

You must use it in a macro, but the macro you can run from a Button.

For example

Sub test()
Sheets(Array("Sheet1", "Sheet3")).PrintOut
'all sheets in the array
End Sub

Where do you place this Macro???

Alt-F11
Insert>Module from the menubar
paste the sub in there
Alt-Q to go back to Excel

If you do Alt-F8 in Excel you get a list of your macro's
Select "test" and press Run

If you add a button from the Forms toolbar on you sheet it will ask you
to assign a macro.
Or right click on the button and choose "Assign macro"

If you use a button from the control toolbox you must enter the name of
the macro in the Click event of the button
 
Back
Top