ChrisM
ChrisM

Reputation: 1586

How can I Unhide every Excel sheet in a workbook using VBA?

How can I Unhide every Excel sheet in a workbook using VBA without having to list all the sheets like below.

Sub UnhideAllSheets()

    Sheets("Sheet1").Visible = True
    Sheets("Sheet2").Visible = True
End Sub

Upvotes: 0

Views: 4919

Answers (1)

ChrisM
ChrisM

Reputation: 1586

You can Unhide all of the sheets in Excel using the following VBA code

Sub UnhideAllSheets()
    Dim ws As Worksheet

    For Each ws In ActiveWorkbook.Worksheets
        ws.Visible = xlSheetVisible
    Next ws

End Sub

Credit to This Website

Upvotes: 2

Related Questions