February 18, 2016

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:

One thought on “How to print hidden and visible worksheets with VBA

  1. God bless you and put the quality of your courses in your balance of good
    Abu.Talha.Of.Morooco

Comments are closed.