UNHIDE all worksheets

C

chris//DDD

I need to unhide all worksheets in my file with a macro...
The number of worksheets can change depending on the file.

Can anyone help me with the VBA code on this?

THANKS!!!
 
K

Ken Wright

Sub ShowSheets()

Dim ws As Worksheet

For Each ws In ActiveWorkbook.Sheets
ws.Visible = xlSheetVisible
Next ws

End Sub
 
A

Anders S

Chris,

One way:

'------
Sub unhideSheets()
Dim wks As Worksheet
For Each wks In ThisWorkbook.Worksheets
wks.Visible = xlSheetVisible
Next
End Sub
'------

HTH
Anders Silvén
 

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