Hide/Unhide sheets

  • Thread starter Thread starter dave
  • Start date Start date
Hi Dave

Try
Sheets("Sheet1").Visible = False
..
..
..
Sheets("Sheet1").Visible = True
 
Public Sub Hidesheets()
Dim sh as Worksheet
for each sh in thisworkbook.worksheets
if sh.Name <> "Sheet1" then
sh.visible = xlSheetHidden
else
sh.Visible = xlSheetVisible
end if
Next
End Sub


as an example.
 
Just to add, the acceptable constants are:

? xlSheetVisible
-1
? xlSheetHidden
0
? xlSheetVeryHidden
2

True is coerced to -1
False is coerced to 0

so they work as well.
 
Back
Top