VBA to Select all sheets in a workbook and unhide them


Posted by Chris Rock on November 13, 2001 11:38 AM

Geez, I know this is simple, but how do you select all sheets in a workbook and unhide them in VBA?



Posted by faster on November 13, 2001 11:44 AM

Here is one way

Sub UnHideAll()
If MsgBox("UnHide All Sheets?", vbYesNo) = vbNo Then
Exit Sub
End If

Dim i
For i = 1 To Sheets.Count
Sheets(i).Visible = True
Next i
End Sub