Hide all Sheets

F

Fable

Greetings,

I got alot of sheets on a workbook and every time the workbook i
closed it hide all sheets except one that is a "logon", is there a vb
command where I can hide all work sheets and then have it unhid
"Logon" only or do I have too type each sheet into an array and use th
visible=true command?

I tried the array method and it works fine for hiding all sheets, bu
when I tried too unhide it gives me an error, may be becuase it can'
find the active sheets?

Any help is appreciated
 
R

Ron de Bruin

With your Logon sheet as the first one you can use this
It is also possible to check the sheet name if you want

Sub HidealmostAll()
Dim a As Integer
For a = 2 To Sheets.Count
Sheets(a).Visible = xlVeryHidden
Next a
End Sub

Sub ShowAll()
Dim a As Integer
For a = 2 To Sheets.Count
Sheets(a).Visible = True
Next a
End Sub
 

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

Top