Computers are like Old Testament gods; lots of rules and no mercy.
- Joseph Campbell

Top Ten Tags

Who's Online

Suppose you have a workbook with many hidden sheets and you want to unhide them all at once. Here's some simple code to unhide all sheets in a workbook. In this case, I assume it is the ActiveWorkbook.

VBA Code

Sub UnhideAllSheets()

    On Error GoTo ErrMsg:

    Dim ws As Worksheet

    For Each ws In ActiveWorkbook.Worksheets
        ws.Visible = xlSheetVisible
    Next ws
    
    MsgBox "Done!", vbInformation, "UnhideAllSheets()"

ExitHere:

    Exit Sub

ErrMsg:
    MsgBox Err.Number & ": " & Err.Description, _
           vbExclamation, "UnhideAllSheets()"
    GoTo ExitHere

End Sub

Link