Excel Macro Unhide tabs

I need a code to unhide all hidden tabs in an excel workbook.
The workbook is open and active.
Euro5Asked:
Who is Participating?
 
2toriaCommented:
This should do the trick for you:-

Sub unhide()

Dim wst As Worksheet

For Each wst In ThisWorkbook.Worksheets
    wst.Visible = xlSheetVisible
Next

End Sub

Open in new window


HTH,
Matt
0
 
nutschCommented:
or if you save the macro in your personal.xls rather than in the workbook itself:

Sub unhide()

Dim sht As Worksheet

For Each sht In [b]Active[/b]Workbook.Worksheets
    sht.Visible = xlSheetVisible
Next

End Sub

Open in new window


Thomas
0
 
nutschCommented:
Of course, the code should be as follows. I thought I'd try putting bold characters within the code window.

Sub unhide()

Dim sht As Worksheet

For Each sht In ActiveWorkbook.Worksheets
    sht.Visible = xlSheetVisible
Next

End Sub

Open in new window


Thomas
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.