I’m sure most of us have experienced frustration at Excel’s refusal to allow us to unhide multiple worksheets.
This is no April Fools' joke! I know it seems illogical to allow the hiding of multiple sheets but not the un-hiding.
Ho, hum....here are a couple of easy fixes:
1. Custom Views
A custom view is a snapshot of how the workbook looks, in terms of structure not content, at a point in time.
So, all you need to do is create a custom view of your workbook with all of the sheets unhidden, then you can merrily hide the sheets in the knowledge that you can quickly unhide them again by selecting your 'custom' view of the workbook.
To create a Custom View first make sure all of your sheets are unhidden > on the View tab select Custom Views > click ‘Add’ in the dialog box:
In the ‘Add View’ dialog box give your Custom View a name:
Tip: if you keep the ‘Print Settings’ and ‘Hidden rows, columns and filter settings’ checked then when you ‘Show’ your Custom View Excel will unhide any hidden rows/column and filters will be removed.
Ok, now you’ve set up your Custom View you can quickly unhide your sheets by selecting it:
View tab > Custom Views > double click the view you want or click the ‘Show’ button:
Note: Custom Views are specific to each Workbook. i.e. If you want to be able to easily unhide multiple sheets in other workbooks you will need to set up a Custom View in each workbook.
If this annoys you too then maybe the next option is for you.
2. VBA to Unhide Multiple Sheets
Now, Custom Views are fine if you already have your sheets unhidden, but what if you have inherited a workbook with 100 hidden sheets? What?....100 hidden sheets is possible!
Well, you still have to unhide them before you can set up your Custom View.
So, here is some VBA code that will unhide all sheets quickity quick:
Option Explicit Sub UnhideAllSheets() Dim HiddenSheet As Worksheet For Each HiddenSheet In ActiveWorkbook.Worksheets HiddenSheet.Visible = xlSheetVisible Next HiddenSheet End Sub
Go ahead and paste it into your Personal Macro Workbook so it’s there for you to use whenever you need.
To add the VBA code to your Personal Macro Workbook:
- Alt+F11 to open the VB Editor, or click on the Developer Tab and click on the Visual Basic icon > locate the ‘PERSONAL.XLSB’ project > right click and Insert a Module (if you don’t already have one):
- Then paste in the code from above in the right hand side of the VB editor:
Add an Icon to your Quick Access Toolbar
Since you’re on a roll why not set up an icon on the Quick Access Toolbar (QAT) so it’s always to hand?
To do this right click the QAT > select ‘Customize the Quick Access Toolbar’:
- Choose ‘Macros’ in the ‘Choose commands from' list
- Double click the Macro to add it to your QAT or click the 'Add' button:
Now Make it Funky
You can even give your shortcut a funky icon so you can easily identify it.
Wiz
Update: Unhiding multiple sheets in Excel is now possible. See https://techcommunity.microsoft.com/t5/excel-blog/unhide-multiple-worksheets/ba-p/2234073
Mynda Treacy
Sure is, but only if you have Microsoft 365.
Sam
Hi. Thanks for the information. This is indeed very helpful! However, I encounter a problem with the icon/ribbon created. If I change the file name or relocate location of file, the ribbon no longer work. It always refer back to the previous file name at the previous location. May I know how to solve this issue so that the ribbon can follow the path though file name or location is changed?
Catalin Bombea
Hi Sam,
Are you using exactly the same code described in this article or you made changes? I’m asking this because the code provided in this article is referring to ActiveWorkbook, not to a specifc file.
Can you upload your code so we can take a look at it?
Catalin
ashish
If you are interested in learning How to Hide Multiple Sheets using VBA
Cathy
Such a shame that Custom Views is “greyed out” when there is a table anywhere in the workbook. Worked around it with a simple macro for each custom view.
Mynda Treacy
Yes, it is annoying. Hopefully they’ll fix that in an upcoming version of Excel.
Glad you found a workaround though.
mynda
Garvin Gilbert
What I am trying to do is only have my dashboard visible and hide all other sheets, is there any way to link a formula to a hidden tab or create a hyperlink on your dashboard to a hidden sheet?
Mynda Treacy
Hi Garvin,
You can link formulas to hidden sheets but you can’t have a hyperlink to a hidden sheet.
Kind regards,
Mynda.
Jeff Weir
Hi Mynda. Helpful post. Note that Custom Views are incompatible with Excel Tables. As soon as you have a Table in your spreadsheet, the Custom Views option is greyed out. Which is a shame, because Custom Views is about the best unknown feature that MS have effectively depreciated.
Regards from across the Tasman.
Jeff
Mynda Treacy
Thanks for dropping by, Jeff 🙂
Good point about the Tables, which I forgot to mention. Indeed, it is a huge shame. I’m a big fan of Tables. At least we still have the VBA option… for now!
Cheers,
Mynda.
Jerry
Great timesaver! I generated a similar snippet previously with some wholly unnecessary bells/whistles: (The bookmark ensures you end up on the worksheet you started on)
Sub UnhideAllWorksheets()
Dim i As Long, j As Long, ws As Long, hidden As Long
Dim Bookmark As Object
Set Bookmark = ActiveSheet
hidden = 0
ws = ActiveWorkbook.Sheets.Count
For i = 1 To ws
If Sheets(i).Visible = False Then hidden = hidden + 1
Next
If hidden = 0 Then MsgBox (“There are no hidden sheets in this workbook.”)
If hidden = 0 Then Exit Sub
If MsgBox(“There are ” & ws & ” total sheets in this workbook.” & vbCrLf & vbCrLf & _
“Do you want to expose the ” & hidden & ” hidden sheets?”, _
vbQuestion + vbYesNo) vbYes Then Exit Sub
For j = 1 To ws
Sheets(j).Visible = True
Next
MsgBox (“All sheets are now visible”)
Bookmark.Activate
End Sub
Mynda Treacy
Cheers, Jerry. Thanks for sharing 🙂
Mynda.
Bruce
Or you can get the Excel Utilities Add-in for free and remove multiple worksheets that way.
Mynda Treacy
Hi Bruce,
I presume you mean an add-in to ‘unhide’ not ‘remove’ multiple sheets? Any particular add-in? There are a few out there. Can you share the link?
Cheers,
Mynda.
richard smith
Hi
I have uploaded the code, but I receive an error as follows: –
Compile error variable not defined Hidden sheet
Please can you help?
Mynda Treacy
Oops, sorry Richard. There was a typo in the VBA code. I’ve fixed it now so you can copy it from above and try again.
Kind regards,
Mynda.