POKE ME for any consultancy

Tuesday, March 8, 2016

Unhide all hidden worksheets by VBA code


The following short VBA code also can help you display all of the hidden sheets at the same time.
1. Hold down the Alt + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following macro in the Module Window.
1
2
3
4
5
6
7
8
Sub UnhideAllSheets()
    Dim ws As Worksheet
 
    For Each ws In ActiveWorkbook.Worksheets
        ws.Visible = xlSheetVisible
    Next ws
 
End Sub
3. Press the F5 key to run this macro. And the hidden sheets will be displayed at once.

No comments:

Post a Comment