Printing using VBA

VbaHell

Well-known Member
Joined
Jan 30, 2011
Messages
1,220
Hello all, I am using Excel 2007 and need help please

I have a workbook which has multiple worksheets, the number of worksheets can change daily.
I am looking for some VBA code I can use to print out every worksheet in one go.
Is this possible please
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try
Code:
Sub PrintSheets()
    Dim x As Integer
    For x = 1 To ActiveWorkbook.Worksheets.Count
        Sheets(x).PrintOut
    Next
End Sub

or even try
Code:
Sub PrintSheets2()
ThisWorkbook.PrintOut
Cancel = True
End Sub
 
Last edited:
Upvote 0
Your welcome. I did add an edit with another obvious option as you were posting.
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,649
Members
448,975
Latest member
sweeberry

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top