How to set password to protect hidden sheet in Excel?
In many work scenarios, your Excel workbook may contain sensitive or important data on hidden sheets—such as employee records, budget details, or formula references. However, anyone with access to the file can simply unhide these sheets using Excel’s built-in functions, unless extra protection is applied. If you want to restrict users from viewing hidden sheets without permission, you’ll need to add password protection. This is especially useful in shared files, collaborative environments, or personal workbooks that require an extra layer of security.
This guide introduces five effective methods to help you password protect hidden worksheets in Excel—from using VeryHidden mode and VBA macros to advanced tools like Kutools. We’ll also cover simpler alternatives like workbook structure protection or manual access prompts using formulas, depending on your needs.
➤ Set password to protect hidden sheets with VeryHidden function
➤ Set password to protect hidden sheet with VBA code
➤ Protect multiple worksheets at once with Kutools for Excel
➤ Alternative: Protect workbook structure
➤ Alternative: Excel formula-based sheet access control (manual approach)
Set password to protect hidden sheets with VeryHidden function
A practical way to enhance hidden sheet security in Excel is to use the VeryHidden property, which makes the worksheet invisible to normal “Unhide” operations. With this method, you not only hide the worksheet but also secure access to it with a password by locking the VBA project. This approach is suitable when you want to protect sensitive data from unauthorized users who might try to view hidden sheets.
1. Open your workbook, and hold Alt + F11 to launch the Microsoft Visual Basic for Applications window.
2. In the Microsoft Visual Basic for Applications window, go to View > Project Explorer and Properties Window to make sure both panes are displayed (these are necessary for sheet and property selection). If Project Explorer is not visible, pressing Ctrl + R can bring it up quickly.
3. In the Project-VBAProject pane, click to select the worksheet you wish to protect. In the Properties pane (often at the bottom left), find the Visible property. Click its dropdown and select xlSheetVeryHidden. Sheets set to VeryHidden cannot be made visible using Excel’s standard Unhide option. (Tip: To reverse this, you'll need to return here and change the property back to xlSheetVisible.)
4. To restrict others from revealing or modifying the VeryHidden property, add password protection to the VBA project itself. In the Microsoft Visual Basic for Applications window, click Insert > Module (optional step for custom code), then go to Tools > VBAProject Properties. This opens a dialog for project settings.
5. In the VBAProject - Project Properties dialog box, go to the Protection tab. Check the box Lock project for viewing. Then, enter and confirm your chosen password in the fields provided. This restricts other users from viewing or editing any modules (including the “VeryHidden” settings) unless they know your password. Remember to choose a strong password and store it securely.
6. Click OK to apply the changes and close the dialog box. After setting the password, close the Microsoft Visual Basic for Applications window to complete the process.
7. To preserve the VBA settings and password protection, you must save your file as an Excel Macro-Enabled Workbook (*.xlsm). Go to File > Save As, select Excel Macro-Enabled Workbook in the "Save as type" dropdown, and then save the file. If you save in regular .xlsx format, all VBA code or hidden property settings will be lost.
8. The next time you or anyone else opens this workbook and attempts to access the “VeryHidden” sheet via VBA, they will be prompted for the password you set. See the screenshot below for the typical prompt dialog:
This method provides a balance between protection and ease of setup. However, note that experienced users familiar with VBA may find ways to bypass simple protections, so it is most effective for general privacy rather than absolute security. Always make backup copies of your file before implementing password protection—to prevent losing access due to forgotten passwords or unexpected issues.
Demo: Set password to protect hidden sheets

Unlock Excel Magic with Kutools AI
- Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands.
- Custom Formulas: Generate tailored formulas to streamline your workflows.
- VBA Coding: Write and implement VBA code effortlessly.
- Formula Interpretation: Understand complex formulas with ease.
- Text Translation: Break language barriers within your spreadsheets.
Set password to protect hidden sheet with VBA code
Another flexible approach is to use VBA code to add password protection logic when unhiding a worksheet. This method allows you to show a password prompt each time someone tries to unhide a particular sheet. It's suitable when you need automated protection with user prompts, or where you want to easily modify security for individual sheets as your needs change.
1. First, hide the worksheet you want to protect. You can do this by right-clicking the sheet tab and selecting Hide.
2. Press ALT + F11 to open the Microsoft Visual Basic for Applications window.
3. In the left Project Explorer panel, find and double-click ThisWorkbook to open its code window. Paste the following VBA code into this module:
VBA code: Set password to protect hidden sheet
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim xSheetName As String
xSheetName = "Sheet1"
If Application.ActiveSheet.Name = xSheetName Then
Application.EnableEvents = False
Application.ActiveSheet.Visible = False
xTitleId = "KutoolsforExcel"
response = Application.InputBox("Password", xTitleId, "", Type:=2)
If response = "123456" Then
Application.Sheets(xSheetName).Visible = True
Application.Sheets(xSheetName).Select
End If
End If
Application.Sheets(xSheetName).Visible = True
Application.EnableEvents = True
End Sub
Note: In the above code example, Sheet1 in xSheetName = "Sheet1" refers to the name of the hidden worksheet you want to protect. Change this to match your actual sheet name. Also, 123456 is used as the default password in If response = "123456" Then. Modify the password to fit your security needs. Make sure you remember the password, as losing it means you may be unable to access your data.
For best results, always save your workbook as a Macro-Enabled Workbook (*.xlsm) to ensure the VBA code remains active. Test the code by right-clicking the sheet tab area and attempting to unhide the protected sheet—upon activation, a password input prompt will appear each time access is attempted.
4. Each time someone tries to show the hidden sheet, they will be prompted to enter the password you set. If the password is correct, the sheet will be visible; otherwise, it remains hidden. This ensures that only authorized users are able to access the protected content.
This VBA solution provides dynamic password control. However, keep in mind that security depends on the secrecy of your VBA code and password. If you want to enhance security, combine this method with VBA project protection as described above. Take care to back up your workbook regularly and inform users of any password requirements to prevent unintended lockouts.
Protect multiple worksheets at once with Kutools for Excel
When you need to protect several or all worksheets at the same time, especially in large workbooks, manual protection one by one can be time-consuming and prone to oversight. Kutools for Excel, an efficient add-in for Excel users, offers a handy Protect Worksheet tool to apply password protection to many worksheets at once, significantly streamlining the process.
With Kutools for Excel installed, follow these steps for quick and batch worksheet protection:
1. Click the Kutools Plus tab, then choose Protect Worksheet. The following screenshot illustrates the menu location:
2. In the Protect Worksheet dialog box, you will see all worksheets listed. Select one or multiple worksheets you want to secure by checking their corresponding boxes. This visual interface makes it easy to review and select desired sheets for protection.
3. Click OK. In the next dialog, enter your password and confirmation, then click OK again. Kutools will prompt you regarding how many worksheets have been protected, minimizing the risk of missing any sheets.
4. Click OK to complete and close the dialogs. Now, all the selected worksheets are protected with the password you entered.
This batch-protection tool is especially useful for users managing workbooks with many sheets or those who need to enforce consistent security standards. Additionally, if you ever need to remove protection from all sheets at once, simply click Kutools Plus > Unprotect Worksheet and enter your password to quickly unprotect all selected sheets.
Download and free trial Kutools for Excel Now !
Compared to manual methods, the Kutools approach greatly reduces setup time and ensures you do not overlook any sheets. Always remember to manage your password securely and share it only with trusted parties.
Alternative: Protect workbook structure
A simpler, built-in way to prevent users from viewing or unhiding hidden worksheets is to protect the structure of your workbook. This disables actions like unhiding, deleting, renaming, or adding worksheets—unless the correct password is provided. It’s quick to set up, doesn’t require VBA, and is ideal for general workbook-level restrictions.
To use this method:
1. Go to the Review tab and click Protect Workbook in the Changes group.
2. In the dialog box, check Structure and enter a password.
3. Click OK and re-enter the password to confirm.
After enabling structure protection, users will be unable to unhide any hidden sheets without the password. However, once the structure is unprotected, all sheets—including hidden ones—can be freely accessed. Therefore, it’s important to use strong passwords and manage them securely.
Alternative: Simulate sheet access control using formulas (manual approach)
Although Excel formulas do not offer real password protection, you can simulate access prompts using a landing sheet with data validation and formulas. This method can be used as a soft deterrent or instructional aid, especially in classroom or training environments where security is not critical.
Basic setup example:
1. In cell B2, prompt users to enter a password.
2. In cell C2, enter the following formula:
=IF(B2="mypassword","Access Granted","Access Denied")
Replace mypassword
with the text string of your choice. You can use Conditional Formatting to change the cell color or font based on whether access is granted.
This approach does not restrict access to the sheet itself—it simply displays instructions based on the user's input. It is best used when the goal is to suggest behavior, not enforce it.
Summary: Best ways to protect hidden sheets in Excel
Depending on your security needs and Excel skill level, there are multiple ways to protect hidden worksheets from unauthorized access:
- VeryHidden + VBA: Provides strong protection by making sheets invisible in the Unhide menu and requiring a password to reveal them.
- VBA-based password control: Ideal for interactive control, such as unhiding only when a correct password is entered.
- Kutools for Excel: Simplifies bulk sheet protection without needing to write code—especially useful for non-technical users.
- Workbook structure protection: A quick native method to prevent users from adding, deleting, or unhiding sheets.
- Formula-based access cues: A lightweight deterrent for casual users—suitable for educational or low-security environments.
For maximum protection, combine VeryHidden sheets with workbook structure protection, and always use strong, memorable passwords. If sharing your file, make sure macros are enabled on the recipient's side and test the protection thoroughly before distribution.
In all cases, make sure to document and securely store your passwords. Forgotten passwords can permanently block access to important data. If you're using macros or add-ins for enhanced protection, always save your file as a macro-enabled workbook (.xlsm), and test your settings carefully after major edits or Excel updates. For best results, create backup copies and validate your protection steps on a regular basis.
Related articles:
How to protect multiple worksheets at once in Excel?
How to set a password to protect the workbook?
How to protect / lock VBA code in Excel?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.





- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in