Unhide Several Sheets

jonas10

New Member
Joined
Jan 31, 2011
Messages
30
Does anyone know a method to unhide several sheets in a workbook at the same time? Rightclicking and selecting unhide im only able to unhide one at a time. I have 40 that I have to unhide and then rehide each day.

Thanks!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
See if this works for you

Code:
[COLOR=#000000]Sub Unhide_Multiple_Sheets()[/COLOR]Dim ws As Worksheet
    
    For Each ws In ActiveWorkbook.Worksheets
        
        ws.Visible = xlSheetVisible
    
    Next ws
 [COLOR=#000000]End Sub[/COLOR]
 
Upvote 0
Hey Jonas,

My suggestion is to use a macro here. Run one to hide and one to unhide.

Code:
Sub HideSheet()
Sheets("ENTER SHEET NAME HERE").Visible = False
End Sub

Code:
Sub UnhideSheet()
Sheets("ENTER SHEET NAME HERE").Visible = True
End Sub

For each sheet you want to hide, make another line.
For example:

Code:
Sub HideSheet()
Sheets("Data").Visible = False
Sheets("Projects").Visible = False
Sheets("Conclusion").Visible = False
End Sub

This would hide the 3 sheets named "Data", "Projects", and "Conclusion".

Let me know if this works and/or if you need more assistance!

Edit: This works best if it's the SAME 40 that you have to hide and unhide daily, which is how it seems to be in this case.
 
Last edited:
Upvote 0
See if this works for you

Code:
[COLOR=#000000]Sub Unhide_Multiple_Sheets()[/COLOR]Dim ws As Worksheet
    
    For Each ws In ActiveWorkbook.Worksheets
        
        [B][COLOR="#FF0000"]If ws.Visible <> xlSheetVeryHidden Then[/COLOR][/B] ws.Visible = xlSheetVisible
    
    Next ws
 [COLOR=#000000]End Sub[/COLOR]
On the off-chance that there are some "Very Hidden" worksheets that should remain "Very Hidden", you might consider adding the If..Then condition I show in red above.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top