unhide sheet macro

  • Thread starter Thread starter Owen
  • Start date Start date
O

Owen

I have some files with many hidden sheets. How do I
unhide ALL of the hidden sheets using the fewest steps?

I would think that I could select multiple sheets to
unhide but I can't. Instead, I have to manually go to the
menu and select: Format, Sheet, Unhide, select a sheet
name, OK; and do this over and over again.

Is there a macro that I can create so that it looks for a
hidden sheet (not a specifically named sheet as the names
vary from file to file), unhide it, then look for the next
hidden sheet and so on until all sheets are unhidden.

Hope there's an answer out there. Thanks.
 
The following macros will hide and unhide all the sheets in the
workbook. When hiding sheets, the last sheet will remain visible.

'=========================
Sub UnhideSheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
End Sub
'==========================
Sub HideSheets()
On Error Resume Next
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Visible = xlSheetHidden
Next ws
End Sub
'===================
 
Owen

Sub Show_Sheets()
Dim I As Integer
For I = 1 To ActiveWorkbook.Worksheets.Count
ActiveWorkbook.Worksheets(I).Visible = True
Next I
End Sub

Gord Dibben Excel MVP
 
Back
Top