Unhiding all worksheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Someone hid about 50 sheets in a workbook. What would be the code to unhide
them all without doing it one by one from the Format menu?

Thank you

Marco
 
Sub Macro1()

Dim sheet As Worksheet
For Each sheet In Worksheets
sheet.Visible = True
Next
End Su
 
Marco

Something like

Sub unhidesheets()
Dim sht As Object
For Each sht In ActiveWorkbook.Sheets
sht.Visible = True
Next sht
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
(e-mail address removed)
 
Macro, try this,

Sub unhide_all_sheets()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Visible = True
Next ws
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
Thanks.

Nick Hodge said:
Marco

Something like

Sub unhidesheets()
Dim sht As Object
For Each sht In ActiveWorkbook.Sheets
sht.Visible = True
Next sht
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
(e-mail address removed)
 
Thanks.

Paul B said:
Macro, try this,

Sub unhide_all_sheets()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Visible = True
Next ws
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 

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