How to Password-Protect Hidden Sheets in Excel (3 Methods)

To demonstrate the methods, we will use a dataset that contains some stores and their incomes, expenses, and profits.

Password Protect Hidden Sheets in Excel


Method 1 – Using the Review Tab to Password-Protect Hidden Sheets in Excel

Steps

  • You can hide the worksheet just by right-clicking on it. In our example, we want to hide a sheet named Protect Workbook. When you right-click on the sheet, an options menu will appear. From it, select the Hide option.

Password Protect Hidden Sheets in Excel

  • This will hide your sheet in the Excel workbook.

  • If your worksheet is not protected with a password, you can unhide the sheet just by right-clicking on it and selecting “Unhide”.

  • To protect your worksheet with a password, first you need to hide your sheet using the method just described.
  • Then click on the Review tab in the ribbon and select Protect Workbook from the Protect group.

Password Protect Hidden Sheets in Excel

  • The Protect Structure and Windows dialog box will open. Set a password and click OK.

  • A Confirm Password dialog box will appear. Re-type your password and click OK.

  • This will eventually protect your sheet with a password. Now, if you right-click on the sheet, the Hide/Unhide options will not be available in the menu.

Password Protect Hidden Sheets in Excel

  • To enable the Unhide option, return to the Review tab in the ribbon and select Protect Workbook from the Protect group.

  • The Unprotect Workbook dialog box will appear. Enter your password to unprotect the sheet then click OK.

Password Protect Hidden Sheets in Excel

Read More: How to Protect Excel Sheet with Password


Method 2 – Applying VeryHidden Function to Password-Protect Hidden Sheets

Steps

  • Press ‘Alt+F11’ to open the Developer tab. You can also open it by customizing the ribbon.

  • In Visual Basic, click the View menu option, and select Project Explorer and Properties Windows respectively.

Password Protect Hidden Sheets in Excel

  • Now, in the VBAProject, select the sheet that you want to hide by using VeryHidden.

  • The selected sheet’s properties will appear at the bottom. Change the Visible option to xlSheetVeryHidden from the drop-down option.

Password Protect Hidden Sheets Using VeryHidden

  • This will automatically hide your selected worksheet. But anyone can unhide this with ease. To prevent this, you need to protect the sheet with a password.
  • Click the Insert menu option and select Module.

  • A blank Module window will appear.
  • Click the Tools menu option and select VBAProject Properties.

Password Protect Hidden Sheets Using VeryHidden

  • The Project Properties dialog box will appear. In it, select the Protection tab.
  • In the Lock Project section, check Lock project for viewing.
  • Set a password and confirm it by re-typing it.
  • Click OK.

Password Protect Hidden Sheets Using VeryHidden

  • Close Visual Basic.
  • Set the Save as type option to Excel Macro-Enabled Workbook and click Save.

  • Now, if you open Visual Basic, you will need to enter the password in order to unhide the sheet.

Password Protect Hidden Sheets in Excel

Read More: How to Protect an Excel Sheet Except for Certain Cells


Method 3 – Using Excel VBA Code to Password-Protect Hidden Sheets

Steps

  • Press ‘Alt+F11’ to open the Developer tab. You can also open it by customizing the ribbon.

  • Click the Insert menu option and select Module.

  • A Module code window will appear. Copy the following code and paste it in this window.
Sub Protect_and_HideSheet()
 Sheets("VBA").Visible = xlSheetVeryHidden
End Sub
  • Close the Visual Basic code window.
  • Click the View menu option in the ribbon and select Macros

  • A Macro dialog box will appear. Select the Protect_and_HideSheet option under Macro Name and click Run.

Embedding VBA Code to Password Protect Hidden Sheets in Excel

  • This will automatically hide your sheet from the Excel workbook, without password protection. To add a password, return to Visual Basic.
  • Open a Module window.
  • Click the Tools menu option and select VBAProject Properties.

Embedding VBA Code to Password Protect Hidden Sheets in Excel

  • A Project Properties dialog box will appear. Select the Protection tab.
  • In the Lock Project section, check Lock project for viewing.
  • Set a password and confirm it by re-typing.
  • Click OK.

Embedding VBA Code to Password Protect Hidden Sheets in Excel

  • Close the Visual Basic window.
  • Save the workbook as type Excel Macro-Enabled Workbook and click Save.

  • Now, if you open the Visual Basic window, your password will be required in order to unhide the sheet.

Password Protect Hidden Sheets in Ex


Download Practice Workbook


 

Related Articles


<< Go Back to Protect Excel Sheet | Excel Protect | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Durjoy Paul
Durjoy Paul

Durjoy Kumar, with a BSc in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, is a dedicated contributor to the ExcelDemy project. His substantial contributions include crafting numerous articles and demonstrating expertise in Excel and VBA. Durjoy adeptly automates Excel challenges using VBA macros, offering valuable solutions for user interface challenges. Apart from creating Excel tutorials, he is interested in Data Analysis with MS Excel, SPSS, C, C++, C#, JavaScript, Python Web Scraping, Data Entry... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo