Unhide Multiple Worksheets in Excel

Mynda Treacy

April 1, 2014

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:

Use Custom View to unhide multiple sheets

In the ‘Add View’ dialog box give your Custom View a name:

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:

show custom view

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:

  1. 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):

    add VBA module

  2. Then paste in the code from above in the right hand side of the VB editor:

paste in VBA

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?

quick access toolbar QAT

To do this right click the QAT > select ‘Customize the Quick Access Toolbar’:

  1. Choose ‘Macros’ in the ‘Choose commands from' list
  2. Double click the Macro to add it to your QAT or click the 'Add' button:

add icon to QAT

Now Make it Funky

You can even give your shortcut a funky icon so you can easily identify it.

choose icon for qat shortcut

AUTHOR Mynda Treacy Co-Founder / Owner at My Online Training Hub

CIMA qualified Accountant with over 25 years experience in roles such as Global IT Financial Controller for investment banking firms Barclays Capital and NatWest Markets.

Mynda has been awarded Microsoft MVP status every year since 2014 for her expertise and contributions to educating people about Microsoft Excel.

Mynda teaches several courses here at MOTH including Excel Expert, Excel Dashboards, Power BI, Power Query and Power Pivot.

17 thoughts on “Unhide Multiple Worksheets in Excel”

  1. 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?

    Reply
    • 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

      Reply
  2. 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.

    Reply
    • Yes, it is annoying. Hopefully they’ll fix that in an upcoming version of Excel.

      Glad you found a workaround though.

      mynda

      Reply
  3. 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?

    Reply
    • Hi Garvin,

      You can link formulas to hidden sheets but you can’t have a hyperlink to a hidden sheet.

      Kind regards,

      Mynda.

      Reply
  4. 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

    Reply
    • 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.

      Reply
  5. 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

    Reply
    • 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.

      Reply
  6. Hi
    I have uploaded the code, but I receive an error as follows: –
    Compile error variable not defined Hidden sheet
    Please can you help?

    Reply
    • 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.

      Reply

Leave a Comment

Current ye@r *