Hide or Protect a Tab in Excel - 2 ways

Add to Favorites
Author: N/A

Two ways to hide worksheets in Excel.

Method 1

You can create a little macro to assign a password in order to access or open a tab in a workbook.

Right click on the tab > view code > paste this macro into the tab window:

Private Sub Worksheet_Activate()

ActiveSheet.Visible = True

pword = InputBox("Please Enter a Password", "Unhide Sheets")

If pword <> "Test" Then
    ActiveSheet.Visible = False
    ActiveSheet.Visible = True
End If

End Sub

Change Test in the above macro to whatever you want your password to be to display the tab.

Method 2

Right click the desired worksheet tab > click View Code

Or, hit Alt+F11 and then choose your worksheet from the left panel.

Select the View Properties window (hit F4 if you don't see it on the left side)

Look to the bottom where it says  'Visible' and select the option select 2 - xlsheetVeryHidden

Hit Alt+F11 to go back to Excel.

Now, you'll have to go through the above steps again in order to change this tab back to visible and to see it, However, most people will not know there is a hidden tab since you won't see it when you right click the tabs and click unhide.

This method should not be used for utterly sensitive data.


In case of very sensitive data being stored in Excel, do one of two things:

Don't store it in Excel!

Use Method 1 and combine that with password protecting your macros.

Question? Ask it in our Excel Forum

Our Excel Courses

Professional Input Forms in Excel

  • Skill Level: All Levels
  • |
  • 5 hours+

How to make a fully featured professional form in Excel that is unbreakable. This includes how to use the form to store, view, edit, and delete data from a data storage worksheet.

Send Emails from Excel

  • Skill Level: All Levels
  • |
  • 2 hours

Send Emails from Excel using VBA and Macros. This course starts from the Basics and builds up to more advanced examples with attaching workbooks, worksheets, PDF's, automatically sending emails, including a signature, error handling, increasing speed, and more.