Can I unhide multiple sheets at once?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Some of my Excel files contain many hidden sheets. When I want to make
changes to the hidden sheets, I have to individually unhide them and this
takes a long time. Is there a way to unhide all hidden sheets at once? This
would be a huge timesaver!
 
How about a toggle that flips Visible to Hidden and vice versa

Sub ToggleHiddenSheets()
'If only selected sheets are to be hidden, then a toggle works well

Dim wkSht As Worksheet
Dim statStr As String
Dim cnt As Long
cnt = 0

For Each wkSht In ActiveWorkbook.Worksheets
If wkSht.Visible = False Then
cnt = cnt + 1
End If
Next wkSht

If cnt > 0 Then
For Each wkSht In ActiveWorkbook.Worksheets
With wkSht
.Visible = Not .Visible
End With
Next wkSht

Else: MsgBox "You have no hidden sheets"
End If
End Sub
 
Back
Top