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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top