How to Hide a Worksheet in Excel (that can not be unhidden)

Hiding and Unhiding worksheets in Excel is a straightforward task.

You can hide a worksheet and the user would not see it when he/she opens the workbook. However, they can easily unhide the worksheet if they want (as we will see later in this tutorial).

But what if you don’t want them to be able to unhide the worksheet(s).

To do that, you need to take a couple of additional steps to make sure the worksheets are ‘very hidden’ (also covered later in this tutorial).

Let’s see how to hide a worksheet in Excel so that it can easily be unhidden, or can not be unhidden.

Regular Way of Hiding a Worksheet in Excel

You can use the below steps to hide a worksheet in Excel:

  • Right-click on the sheet tab that you want to hide.
  • Click on Hide.Hide a worksheet in Excel - right click and select Hide

This would instantly hide the worksheet, and you will not see it in the workbook. This setting remains intact when you save the workbook and reopen it again, or send it to some else.

PRO TIP: To hide multiple sheets at one go, hold the Control key and then select the sheet tabs (that you want to hide) one by one. Once selected, right-click on any one of the selected tabs and click on ‘Hide”. This will hide all the worksheets at one go.

While this method hides the worksheet, it’s extremely easy to unhide these worksheets as well.

Here are the steps to unhide a worksheet in Excel:

  • Right-click on any of the existing tabs.
  • Click on Unhide.Right click and select Unhide option
  • In the Unhide dialog box, select the sheet you want to unhide.Select the sheet you want to unhide in Excel
  • Click OK.

This will instantly make the sheet visible in the workbook.

Note that you can only unhide one sheet at a time. To unhide multiple sheets, you need to repeat the above steps to unhide each worksheet. Alternately, you can use a macro code to unhide all the worksheets at one go.

While this method works in most cases, it doesn’t really help if you want to hide the worksheets so that your client or colleague (or anyone with whom you share the workbook) can’t unhide and view these.

All they need to do is right-click on any of the tabs and they will see what all worksheets are hidden (and unhide these easily).

So let’s see how you can really hide a worksheet so that it can not be unhidden (at least not so easily).

Hide a Worksheet So That It Can Not be Unhidden

Here are the steps to hide a worksheet so that it can not be unhidden:

  • Right-click on any of the worksheet tabs.
  • Click on View Code.hide worksheet in Excel - right click and view code
  • In the VB Editor, in the project explorer in VB Editor, select the worksheet you want to hide.To hide a worksheet - select Sheet2 in the Project Explorer
  • With the sheet selected, click on the Properties icon in the toolbar (or use the keyboard shortcut F4).Properties Icon in the Vb Editor Toolbar
  • In the Properties pane that opens, select the drop-down in front of the option “Visible”.Visible Property of the worksheet
  • Select ‘2 – xlSheetVeryHidden’.xlSheetVeryHidden selected to hide the worksheet in Excel
  • Close the VB Editor.

Now you will notice that the sheet is hidden.

When you right-click on any of the tabs, you will not see it in the list of hidden sheets that you can unhide.

Is this method foolproof? – NO!

This method works as a user can not see the hidden sheet in the list of sheets that he/she can unhide.

But this doesn’t mean that the sheet can’t be unhidden.

Unhide a Sheet that has been ‘Very Hidden’

Here are the steps to unhide a sheet that has been ‘Very Hidden’:

  • Right-click on any of the existing tabs.
  • Click on View Code.hide worksheet in Excel - right click and view code
  • In the VB Editor, click on the sheet name you want to unhide (it will be available in the project explorer as a part of the Workbook objects).To hide a worksheet - select Sheet2 in the Project Explorer
  • If the properties pane is not visible, click on the Properties icon in the toolbar (or use the keyboard shortcut F4).Properties Icon in the Vb Editor Toolbar
  • In the Properties pane, change the Visible property from ‘2 – xlSheetVeryHidden’ to ‘-1 – xlSheetVisible’.make sheet visible to unhide it in Excel
  • Close the VB Editor.

This will unhide the worksheet and it will be visible in the workbook.

Hide/Unhide Worksheets Using VBA

If you have a lot of worksheets that you need to hide/unhide, it can take up a lot of your time.

Using a simple VBA code can automate this task for you.

Hide All Worksheets Using VBA

Below is the VBA code that will hide all the worksheets except the current/active worksheet:

'This macro will hide all the worksheet except the active sheet
Sub HideAllExceptActiveSheet()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> ActiveSheet.Name Then ws.Visible = xlSheetHidden
Next ws
End Sub

The above code would hide all the worksheet except the except the active sheet. However, it will hide it so that these can be unhidden easily (note that ws.Visible property is set to xlSheetHidden).

If you want to hide the sheets so that these can not be unhidden, use the below code:

'This macro will hide all the worksheet except the active sheet
Sub HideAllExcetActiveSheet()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> ActiveSheet.Name Then ws.Visible = xlSheetVeryHidden
Next ws
End Sub

The only change we have done here is making the ws.Visible property xlSheetVeryHidden.

Unhide All Worksheets Using VBA

Below is the code that will unhide all the hidden worksheets in the workbook.

'This code will unhide all sheets in the workbook
Sub UnhideAllWoksheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
End Sub

Using this code, we simply go through each worksheet one by one and make the ws.Visible property equal to xlSheetVisible.

Where to put the code?

Below are the steps to place the code in the VB Editor:

  • Click on the Developer tab.Developer tab in the ribbon
  • Click on the Visual Basic icon (or use the keyboard shortcut – ALT + F11).Visual Basic icon in the ribbon
  • In the VB Editor, right-click on any of the objects of the workbook.
  • Go to Insert and select Module. This will insert a new module in the workbook.Insert module to copy code to hide and unhide sheet in Excel
  • Double click on the Module icon and copy and paste the code in the module code window.Paste the code to hide unhide worksheet in the module window

Now you can assign the macro to a shape or run it from the Developer tab. You can read more about different ways to run a macro in Excel here.

Note that you don’t need to insert a new module for each code. You can have one single module and have multiple VBA macro codes in it.

You May Also Like the Following Excel Tutorials:

  • Really

    Very nice. THANKS.