Is it possible to have a button to click on to print all worksheets in a workbook? If so, can someone tell me how?
Thanks!!
Mitch
Is it possible to have a button to click on to print all worksheets in a workbook? If so, can someone tell me how?
Thanks!!
Mitch

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.
The following macro will print all sheets in the activeworkbook:
Sub PrintEmAll()
ActiveWorkbook.PrintOut
End Sub
You can assign this macro to a custom toolbar button, or place a button from the Forms toolbar on a sheet and assign the above macro to it.
Hans, I forgot to ask... What if I only want to print "visible" worksheets and not print hidden???
Thanks.
[quote name='HansV' post='763453' date='04-Mar-2009 21:17']The following macro will print all sheets in the activeworkbook:
Sub PrintEmAll()
ActiveWorkbook.PrintOut
End Sub
You can assign this macro to a custom toolbar button, or place a button from the Forms toolbar on a sheet and assign the above macro to it.[/quote]
[quote name='mitjones' post='763457' date='04-Mar-2009 21:27']Hans, I forgot to ask... What if I only want to print "visible" worksheets and not print hidden???
Thanks.[/quote]
Try this:
[codebox]Sub VisibleSheets()
Dim VisSht As Long
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
If VisSht = xlSheetVisible Then
VisSht.PrintOut
End If
Next sh
End Sub[/codebox]
MTA: Change to original post as I had "unhidden" worksheets....this is basically the same as Hans' post, Thanks Hans
Jerry
[quote name='Jezza' post='763461' date='04-Mar-2009 22:37'][/quote]
Jerry, your code will temporarily unhide hidden sheets and print them. Mitch did *not* want to print hidden sheets.
Aaahhhh Silly me, this some code I had in an old workbook, I'll change it thanks
Jerry
Mitch, you can in fact use my original macro - it skips hidden sheets automatically. No need to loop through the sheets!