Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel VBA: How to Unhide a Very Hidden Sheet

· 6 min read · Home Tech

In this article
  1. What “very hidden” means
  2. Unhide one sheet with a macro
  3. Unhide a sheet from the Immediate window
  4. Reveal every very hidden worksheet
  5. Check the visibility setting and common errors
  6. Protection, passwords, and limits
  7. Frequently Asked Questions

In Excel VBA, change a very hidden worksheet’s Visible property to xlSheetVisible. For example, in the Visual Basic Editor’s Immediate window, run Worksheets("Report").Visible = xlSheetVisible; or use the macro below to reveal a named sheet. Save a copy of the workbook first, because running a macro cannot be undone with Ctrl+Z.

What “very hidden” means

Excel has three visibility states for a worksheet. A visible sheet appears as a tab. A normally hidden sheet can be restored through Excel’s Unhide command. A very hidden sheet does not appear in that command’s list; its visibility is controlled through the worksheet’s VBA property instead.

The relevant property is Worksheet.Visible. Its possible settings include xlSheetVisible, xlSheetHidden, and xlSheetVeryHidden. “Very hidden” is a visibility setting, not a separate kind of worksheet, and changing it to visible does not delete or rewrite the sheet’s cell contents.

Unhide one sheet with a macro

In Excel for Microsoft 365 on Windows, press Alt+F11 to open the Visual Basic Editor. In the editor, choose Insert > Module, paste the code below into the new module, and replace Report with the worksheet’s actual tab name. Then place the cursor inside the procedure and press F5 to run it. If Excel asks, select the macro named UnhideReport.

Sub UnhideReport()
    Dim ws As Worksheet

    ' Change Report to the exact worksheet tab name.
    Set ws = ThisWorkbook.Worksheets("Report")
    ws.Visible = xlSheetVisible
End Sub

ThisWorkbook means the workbook containing the VBA code. That is usually appropriate when the macro is stored in the workbook being changed. If the code is in another workbook, such as Personal.xlsb, use an explicit workbook reference instead, for example Workbooks("Budget.xlsx").Worksheets("Report").Visible = xlSheetVisible. The workbook name must match an open workbook.

Save a copy before running the macro. VBA actions generally cannot be reversed with Excel’s Undo command, so the copy gives you a way to recover if you reveal or alter the wrong sheet.

Unhide a sheet from the Immediate window

For a one-time change, you do not need to create a macro. Open the Visual Basic Editor with Alt+F11, then open the Immediate window with Ctrl+G. Enter this line, replacing Report with the exact sheet name, and press Enter:

ThisWorkbook.Worksheets("Report").Visible = xlSheetVisible

If the workbook containing the target sheet is not the one holding the code, specify its open workbook name:

Workbooks("Budget.xlsx").Worksheets("Report").Visible = xlSheetVisible

These commands require the workbook to be open and macros or VBA access not to be blocked by security settings. A sheet name must match its worksheet tab name, including spaces and punctuation. The worksheet’s VBA code name is a different identifier; using the tab name in Worksheets("...") is often the clearest option.

Reveal every very hidden worksheet

If you are unsure which sheets are very hidden, this macro makes every worksheet in the workbook visible. It also changes sheets that were only normally hidden, so use it only when that broader result is intended.

Sub UnhideAllWorksheets()
    Dim ws As Worksheet

    ' Make each worksheet visible in this workbook.
    For Each ws In ThisWorkbook.Worksheets
        ws.Visible = xlSheetVisible
    Next ws
End Sub

This loop covers worksheets, not chart sheets. A chart sheet is a separate sheet type, and it is not included in the Worksheets collection. If the workbook has chart sheets you also need to reveal, inspect them separately through the VBA editor or use the workbook’s broader Sheets collection with care.

Check the visibility setting and common errors

To inspect a sheet’s state, open the Visual Basic Editor, select the worksheet in Project Explorer, and press F4 to show the Properties window. Find the Visible property. It may display -1 - xlSheetVisible, 0 - xlSheetHidden, or 2 - xlSheetVeryHidden. You can also select a sheet in the editor and inspect its properties without changing them.

  • “Subscript out of range”: Check the workbook reference and exact worksheet tab name. A typo, a closed workbook, or a sheet in a different workbook can cause this error.
  • The sheet is still not visible: Confirm that the command ran against the intended workbook and worksheet. Check whether the workbook structure is protected; protection can prevent changing sheet visibility.
  • The VBA editor is unavailable: On Windows, Alt+F11 opens it when keyboard shortcuts are enabled. If Developer is not on the ribbon, enable it through File > Options > Customize Ribbon and select Developer.
  • The macro will not run: Excel may block macros because of security settings, the file’s location, or its file type. Use only code you trust, and do not lower security protections indiscriminately.

Protection, passwords, and limits

Workbook structure protection can stop users from changing worksheet visibility. If a visibility change is refused, check the Review tab for workbook protection controls, or ask the workbook owner for authorized access. A VBA macro is not a legitimate substitute for permission, and a very hidden sheet should not be treated as a secure place for confidential information. Hiding a sheet controls what is displayed; it does not encrypt the data.

There is an important distinction between a protected workbook and a locked VBA project. Workbook structure protection relates to operations such as adding, deleting, moving, or hiding sheets. A locked VBA project can prevent you from inspecting or editing its code, but it does not necessarily prevent an authorized user from changing a worksheet’s visibility through another available route. If the project or workbook is password-protected, use the password or contact its owner rather than attempting to bypass protection.

For a macro-enabled workbook, save changes in a format that supports VBA, such as .xlsm. Saving as .xlsx removes VBA code from the saved file. The sheet’s visibility change may be retained, but the macro itself will not be.

Frequently Asked Questions

Can I unhide a very hidden sheet without VBA?
Not through Excel’s regular Unhide dialog. You can change the Visible property in the Visual Basic Editor’s Properties window, or run a VBA command. Both methods use the VBA environment.

Why does the sheet not appear in Excel’s Unhide list?
That list includes normally hidden worksheets, not worksheets set to xlSheetVeryHidden. Change the sheet’s Visible property to xlSheetVisible to make it appear as a tab.

Can I run the code on a sheet in another workbook?
Yes, if that workbook is open. Refer to it by its workbook name, such as Workbooks("Budget.xlsx").Worksheets("Report").Visible = xlSheetVisible, and check that the name matches exactly.

Does unhiding a sheet remove workbook protection?
No. Visibility and protection are separate settings. If workbook structure protection prevents the change, you need authorized access to remove or manage that protection.

Does this work in Excel for Mac or Excel for the web?
Excel for Mac supports VBA, though the Visual Basic Editor shortcut can differ by keyboard and system settings; use the Developer tab to open Visual Basic if needed. Excel for the web cannot create, edit, or run VBA macros, so open the workbook in the desktop app to use these instructions.