Can I unhide multiple sheets at once?

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!
 
K

Ken Wright

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top