How to print hidden and visible worksheets with VBA

How to print hidden and visible worksheets in a workbook with VBA. Watch the training video below:

Watch the video on YouTube.

Here’s the complete VBA code to print all worksheets in an Excel workbook quickly and easily:

Sub Print_Visible_Hidden_Sheets()
Dim myBoolean As Long
Dim wksht As Worksheet
For Each wksht In ActiveWorkbook.Worksheets
With wksht

myBoolean = .Visible
.Visible = xlSheetVisible
‘.printout
.PrintPreview
.Visible = myBoolean
End With

Next wksht

End Sub

Further Reading:

Leave a Reply

Your email address will not be published. Required fields are marked *