How to quickly unhide all worksheets in a workbook?

  • Thread starter Thread starter Murtaza
  • Start date Start date
Murtaza said:
How to quickly unhide all worksheets in a workbook?

Paste this into a module, and run it:

You can remove the dialogue box check, but I don't generally recommend
it!

If all you want is the guts, use the code below (bottom).

Alan.




Sub UnhideAllSheets()

' Declarations

Dim Shts As Worksheets
Dim Sht As Worksheet
Dim Response As VbMsgBoxResult



' Check that the user does want to do this and if so...
' Loop through each sheet and unhide

Response = MsgBox("This will unhide ALL the sheets in this workbook.
Are you sure you want to do this?", vbYesNo, "Are you sure?")


If Response = vbYes Then

For Each Sht In ActiveWorkbook.Worksheets

Sht.Visible = xlSheetVisible

Next

End If

End Sub




Sub UnhideAll _GutsOnly()

For Each Sht In ActiveWorkbook.Worksheets

Sht.Visible = xlSheetVisible

Next

End Sub
 
Thanks dude!

Alan said:
Paste this into a module, and run it:

You can remove the dialogue box check, but I don't generally recommend
it!

If all you want is the guts, use the code below (bottom).

Alan.




Sub UnhideAllSheets()

' Declarations

Dim Shts As Worksheets
Dim Sht As Worksheet
Dim Response As VbMsgBoxResult



' Check that the user does want to do this and if so...
' Loop through each sheet and unhide

Response = MsgBox("This will unhide ALL the sheets in this workbook.
Are you sure you want to do this?", vbYesNo, "Are you sure?")


If Response = vbYes Then

For Each Sht In ActiveWorkbook.Worksheets

Sht.Visible = xlSheetVisible

Next

End If

End Sub




Sub UnhideAll _GutsOnly()

For Each Sht In ActiveWorkbook.Worksheets

Sht.Visible = xlSheetVisible

Next

End Sub
 
Back
Top