
- MS Excel Basics
- Excel - Home
- Excel - Getting Started
- Excel - Explore Window
- Excel - Backstage
- Excel - Entering Values
- Excel - Move Around
- Excel - Save Workbook
- Excel - Create Worksheet
- Excel - Copy Worksheet
- Excel - Hiding Worksheet
- Excel - Delete Worksheet
- Excel - Close Workbook
- Excel - Open Workbook
- Excel - Context Help
- Editing Worksheet
- Excel - Insert Data
- Excel - Select Data
- Excel - Delete Data
- Excel - Move Data
- Excel - Rows & Columns
- Excel - Copy & Paste
- Excel - Find & Replace
- Excel - Spell Check
- Excel - Zoom In-Out
- Excel - Special Symbols
- Excel - Insert Comments
- Excel - Add Text Box
- Excel - Undo Changes
- Formatting Cells
- Excel - Setting Cell Type
- Excel - Setting Fonts
- Excel - Text Decoration
- Excel - Rotate Cells
- Excel - Setting Colors
- Excel - Text Alignments
- Excel - Merge & Wrap
- Excel - Borders and Shades
- Excel - Apply Formatting
- Formatting Worksheets
- Excel - Sheet Options
- Excel - Adjust Margins
- Excel - Page Orientation
- Excel - Header and Footer
- Excel - Insert Page Breaks
- Excel - Set Background
- Excel - Freeze Panes
- Excel - Conditional Format
- Working with Formula
- Excel - Creating Formulas
- Excel - Copying Formulas
- Excel - Formula Reference
- Excel - Using Functions
- Excel - Builtin Functions
- Advanced Operations
- Excel - Data Filtering
- Excel - Data Sorting
- Excel - Using Ranges
- Excel - Data Validation
- Excel - Using Styles
- Excel - Using Themes
- Excel - Using Templates
- Excel - Using Macros
- Excel - Adding Graphics
- Excel - Cross Referencing
- Excel - Printing Worksheets
- Excel - Email Workbooks
- Excel- Translate Worksheet
- Excel - Workbook Security
- Excel - Data Tables
- Excel - Pivot Tables
- Excel - Simple Charts
- Excel - Pivot Charts
- Excel - Keyboard Shortcuts
- MS Excel Resources
- Excel - Quick Guide
- Excel - Useful Resources
- Excel - Discussion
How to Automatically Hide Specific Worksheets When Opening an Excel File?
In Excel, you may want to auto-hide a specific sheet but do not want to delete it because it contains sensitive information that you do not want to share. We can accomplish this by utilising the VBA application. This article will help you understand how we can automatically hide specific worksheets when opening an Excel file. This tutorial will help you understand how you can automatically hide a single sheet and multiple sheets in Excel.
Automatically Hide a Single Worksheet
Here we will apply the VBA code to the whole workbook, and we will mention the sheet name in code. Let us see a straightforward process to see how we can automatically hide a single worksheet when opening an Excel file.
Step 1
Let us consider an Excel workbook that contains multiple worksheets. Right-click on any sheet name and select View Code to open the VBA application. then double-click on this workbook and type the programme into the textbox as shown in the below image.
Example
Private Sub Workbook_Open() 'Updated By Nirmal Sheets("Sheet3").Visible = False End Sub
In the code, "Shtee3” is the name of the sheet we are hiding.

Step 2
Now, save the sheet as a macro-enabled workbook and close it. The next time you open it, click on the enable code button to automatically hide Sheet 3.

Automatically Hide Multiple Worksheets
The sheet name will be grouped here and mentioned in the code. Let us see an effortless process to see how we can automatically hide multiple worksheets in an Excel workbook.
Step 1
Let us consider an Excel workbook that contains multiple worksheets. In any worksheet, enter the list of sheet names you want to hide, select them, and name them, as shown in the image below.

Step 2
Now right-click on any sheet name and select View Code to open the VBA application, and double-click on this workbook and type the programme into the textbox as shown in the below image.
Example
Private Sub Workbook_BeforeClose(Cancel As Boolean) 'Update By Nimral Dim ws As Worksheet For Each ws In Worksheets ws.Visible = xlSheetVisible Next ws End Sub Private Sub Workbook_Open() Dim ws As Worksheet For Each ws In Worksheets If WorksheetFunction.CountIf([Hidesheets], ws.Name) > 0 Then ws.Visible = xlSheetHidden MsgBox ws.Name & "Has been hidden!", vbInformation, "Kutools for Excel" Else ws.Visible = xlSheetVisible End If Next ws Set ws = Nothing End Sub

Step 3
Close the sheet, save it as a macro-enabled workbook, and then close it. The next time you open the sheet, click on the enable code button to automatically hide it, as shown in the image below.

Conclusion
In this tutorial, we used a simple example to demonstrate how we can automatically hide multiple worksheets in an Excel workbook.
- Related Articles
- How to Automatically Protect All Worksheets When Closing an Excel Workbook?
- How to Automatically Hide Columns Based on Date in Excel?
- How to Start at Cell A1 Always when Opening an Excel Workbook?
- How to Automatically Open Files When Starting Excel?
- How to Automatically Save and Close an Excel File after a Certain Idle Time?
- How to Automatically Move the Cursor to a Specific Cell in Excel?
- How to clear filters when opening, saving or closing workbook in Excel?
- How to Always Start the Same Worksheet When Opening a Workbook in Excel?
- How to Automatically Reapply Auto-Filter When the Data Changes in Excel?
- How to AutoSum Multiple Rows/Columns/Worksheets in Excel?
- How to Add New Worksheets with Customized Names in Excel?
- How to Combine Data from Multiple Excel Worksheets into One?
- How to Apply Conditional Formatting across Worksheets /Workbooks in Excel?
- How to Automatically Insert Rows in Excel?
- How to Automatically Enter Date When Data is Entered in a Column in Excel?
