Yes, you can unhide sheets, rows, columns and even "very hidden" worksheets with Excel VBA, usually with a single line of code such as Sheets("Sheet2").Visible = xlSheetVisible. VBA is the fastest way to unhide many items at once, and it is the only practical way to reveal a worksheet that has been set to xlSheetVeryHidden, since those do not appear in Excel's normal Unhide dialog at all. This guide covers unhiding worksheets, rows and columns, plus a loop that un-hides everything in the workbook.

What You'll Need

  • Excel for Windows or Mac with a workbook containing hidden sheets, rows or columns. Macros cannot be written or run in Excel for the web.
  • The workbook saved as a macro-enabled file (.xlsm) if you want to keep the code. A plain .xlsx file can run code typed in during a session but will not save it.
  • The Developer tab visible on the ribbon. If it is missing, right-click the ribbon, choose Customize the Ribbon, and tick Developer in the right-hand list.
  • Macros enabled when you open the file. If you see a security warning above the formula bar, click Enable Content only if you trust the file.

Step-by-Step

  1. Open the Visual Basic Editor. Press Alt + F11 (on Mac: Option + F11 or Fn + Option + F11), or go to the Developer tab and click Visual Basic.
  2. Insert a module. In the editor's menu choose Insert > Module. A blank code window opens. Label names can differ slightly between Excel versions, but this path is the same in all current ones.
  3. Unhide a single worksheet. Type the following, replacing the name with your sheet's name exactly as spelled on its tab:
    Sub UnhideSheet()
        ThisWorkbook.Sheets("Sheet2").Visible = xlSheetVisible
    End Sub
  4. Run the macro. Click anywhere inside the code and press F5, or return to Excel and use Developer > Macros, select UnhideSheet, and click Run. The sheet tab reappears at its original position.
  5. Unhide every sheet at once. Add this second macro and run it the same way:
    Sub UnhideAllSheets()
        Dim ws As Worksheet
        For Each ws In ThisWorkbook.Worksheets
            ws.Visible = xlSheetVisible
        Next ws
    End Sub
  6. Unhide rows or columns. To reveal everything on the active sheet, run:
    Sub UnhideRowsColumns()
        Cells.EntireRow.Hidden = False
        Cells.EntireColumn.Hidden = False
    End Sub
  7. Unhide a specific range's rows or columns. For example, to unhide columns C to E on Sheet1:
    Sub UnhideRange()
        ThisWorkbook.Sheets("Sheet1").Range("C:E").EntireColumn.Hidden = False
    End Sub
  8. Save the workbook. Use File > Save As and pick Excel Macro-Enabled Workbook (*.xlsm) so the module is kept for future use.

Only run macros from files you trust. Never enable macros in a workbook from an unknown source, as macros can run harmful code.

Common Mistakes

  • Wrong sheet name or unescaped quotes. A name typed as Sheet 2 when the tab reads Sheet2 throws error 9 (subscript out of range). Copy the name exactly.
  • Trying to hide the last visible sheet in reverse. When hiding (not unhiding), Excel refuses to hide the only visible sheet; unhide at least one other sheet first if you get that error.
  • Using Worksheets when the workbook has chart sheets. The Worksheets collection skips chart sheets. Use Sheets in your loop if chart sheets exist.
  • Forgetting to save as .xlsm. Closing a .xlsx file discards the module silently.
  • Expecting the Unhide dialog to show very hidden sheets. It never does; that is precisely why you need VBA for them.

Tips

  • Instead of a macro, you can also unhide a very hidden sheet directly in the editor: select the sheet in the Project Explorer pane, press F4 to open Properties, and change the Visible property to -1 - xlSheetVisible. No code needed.
  • To hide a sheet so colleagues cannot unhide it via the right-click menu, set Visible = xlSheetVeryHidden. It is still not secure protection; anyone with VBA access can reverse it.
  • Add Application.ScreenUpdating = False at the start of a large loop and Application.ScreenUpdating = True at the end to speed it up noticeably on big workbooks.
  • Store your unhide-all macro in the Personal Macro Workbook so it is available in every file you open.
  • The shortcut Ctrl + Shift + 0 unhides hidden columns and Ctrl + Shift + 9 unhides rows without any VBA, when only a small area is hidden.

Troubleshooting

  • Run-time error 9, subscript out of range: the sheet name in the code does not exist. Check the exact tab name in Excel, including extra spaces.
  • Run-time error 1004 on unhide: the workbook structure is protected. Go to Review > Protect Workbook and unprotect it, then run the macro again. You will need the password if one was set.
  • Nothing happens when you press F5: the cursor may be outside the Sub. Click inside the code body first. Also check the status bar in Excel afterwards, since a successful unhide gives no message box.
  • Macros are disabled: close the workbook, then in File > Open navigate to it and open it via the dropdown arrow next to Open, choosing Open and Repair only if damaged; otherwise adjust macro settings under File > Options > Trust Center > Trust Center Settings > Macro Settings, or add the folder to trusted locations.
  • The macro worked but the change vanished: you probably closed without saving, or saved over an .xlsx file, dropping the module. Re-add the code and save as .xlsm.
  • A sheet is still invisible after UnhideAllSheets: it may be filtered rather than hidden. Clear filters via Data > Clear in the Sort & Filter group.

Frequently Asked Questions

How do I unhide all sheets in Excel using VBA?

Loop through the workbook with For Each ws In ThisWorkbook.Sheets and set each ws.Visible = xlSheetVisible. The full macro is in Step 5 above.

What is the difference between hidden and very hidden sheets?

A normal hidden sheet appears in the right-click Unhide dialog; a very hidden sheet does not and can only be restored through VBA or the editor's Properties window.

Can I unhide sheets without VBA?

Yes, for normally hidden sheets: right-click any sheet tab and choose Unhide. Very hidden sheets require VBA or the Properties window in the Visual Basic Editor.

Why can't I see the Unhide option when I right-click a tab?

Either no sheet is normally hidden, all hidden sheets are very hidden, or the workbook structure is protected. Check Review > Protect Workbook and try the VBA approach.

Does this work in Excel for the web?

Partially. Excel for the web can unhide normally hidden sheets through its own interface, but it cannot run or record VBA macros, so very hidden sheets must be fixed in the desktop app.

Will unhiding sheets with a macro remove sheet protection?

No. Making a sheet visible does not change any worksheet protection, passwords, or locked cells on it; those remain exactly as they were.