How to hide all worksheets except the specified or active one in Excel?
When working with Excel workbooks that contain many worksheets, navigating and managing your data efficiently can become challenging. In situations such as sharing a report, protecting sensitive information, or simply reducing workspace clutter, you might wish to hide all worksheets except for one particular sheet—often the one you are actively working on. By displaying only the relevant worksheet, you can keep your workbook clean, minimize user confusion, and direct attention to key content.
This article demonstrates two practical methods for achieving this task in Excel. Whether you prefer to use VBA code for flexibility or Kutools for Excel for a more straightforward approach, you'll find a solution that meets your needs.
Hide all worksheets but the specified one in Excel with VBA code
Hide all worksheets but the active one with Kutools for Excel (just several clicks)
Hide all worksheets but the specified one in Excel with VBA code
For those who are comfortable with simple automation, using VBA (Visual Basic for Applications) provides flexibility to hide all worksheets except the one you specify. This is particularly useful when managing complex workbooks in professional settings or when creating templates for distribution. You have granular control over which sheet remains visible, and you can easily modify the macro for batch operations in the future. However, please note that using VBA requires saving the file as a macro-enabled workbook (*.xlsm), and users must have macros enabled to run these codes.
To perform this operation, follow the steps below carefully:
1. In your opened workbook, first activate the worksheet you want to keep visible. This ensures you do not accidentally hide the sheet you are working with. Then, press Alt + F11 at the same time to open the Microsoft Visual Basic for Applications editor window.
2. Within the Visual Basic for Applications window, go to the menu and click Insert > Module. This will add a new module where you can enter your VBA code. See screenshot:
3. Copy and paste the following VBA code into the blank editing area of the module window.
VBA code: hide all sheets except specified one
Sub SheetHidden()
Dim xWs As Worksheet
Dim xName As String
xName = Application.InputBox("Range", xTitleId, Application.ActiveSheet.Name, Type: = 2)
For Each xWs In Application.ActiveWorkbook.Worksheets
If xWs.Name <> xName Then
xWs.Visible = xlSheetHidden
End If
Next
End Sub
4. After you have pasted the code, ensure that your desired worksheet is the one currently active in your Excel window. Then, press F5 to execute the code, or select Run from the VBA toolbar. This will trigger a dialog where, by default, the name of your active sheet will be shown in the Range box. Generally, you can just click the OK button without making changes. If you want to select another sheet, you can do so at this step.
5. Upon confirmation, the macro will immediately hide all other worksheets in the workbook except the one you specified. This saves you many manual steps and helps keep your workspace organized, especially when dealing with large multi-sheet files or when preparing a file for others to use.
Remember that hidden worksheets are not deleted—they can be unhidden at any time. However, if your workbook contains only one visible worksheet, Excel will not allow you to hide it, so make sure at least one sheet remains visible. If you need to make all sheets visible again, use the following simple VBA code.
Note: To unhide all previously hidden worksheets, return to the VBA editor by pressing Alt + F11. Insert a new module or use the one you previously used, paste the code below into the code window, and press F5 to run the code. This will restore the visibility of all sheets in your workbook for further editing or review.
VBA code: show hidden worksheets
Sub SheetUnHidden()
Dim xWs As Worksheet
For Each xWs In Application.ActiveWorkbook.Worksheets
xWs.Visible = True
Next
End Sub
Hide all worksheets but the active one with Kutools for Excel (only one click)
If you prefer a faster and more user-friendly option, especially if you frequently need to manage multiple sheets, Kutools for Excel provides a simple solution. This method is suitable for users who wish to avoid writing and running code, or for those who regularly prepare workbooks for sharing and want an efficient workflow. Kutools offers a dedicated feature that allows you to hide all unselected sheets with just a couple of mouse clicks.
To use this method, follow these straightforward steps:
1. First, activate (click on) the worksheet you want to keep visible in your workbook. It is important to confirm this step, as Kutools will keep only the active sheet unhidden after the operation.
2. Next, go to the Excel ribbon and click on the Kutools tab. Then navigate to Show & Hide and select Hide Unselected Sheets from the dropdown menu. This will immediately hide all the other worksheets in your current workbook except for the one you are working on.
Applying this action is especially helpful when sharing files with colleagues or clients, focusing a presentation, or protecting supporting data from accidental changes. The process is instant—no additional prompts or configurations are needed.
Should you later need to restore (unhide) all the previously hidden sheets, Kutools makes this process equally simple. Click Kutools > Show / Hide > Unhide All Sheets. Kutools will instantly unhide all worksheets in the workbook.
Notes and Considerations: When using Kutools, make sure you have selected the correct sheet before applying the hiding tool. This function cannot be undone with the standard Undo command (Ctrl+Z), but you can always unhide all sheets as described above. Additionally, Kutools offers more batch worksheet management features that can save time in more complex scenarios.
Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now
Alternative Solutions: In addition to the methods above, you may consider other approaches depending on your workflow needs:
- Manual Hide/Unhide: You can right-click any worksheet tab and use the Hide or Unhide options. While suitable for hiding a small number of sheets, this method is time-consuming for large workbooks.
- Group Select and Hide: Hold Ctrl and click on the sheets you wish to hide (excluding the one to remain visible), then right-click one of the selected sheet tabs and choose Hide. This is quicker than hiding sheets individually but less efficient than the above VBA or Kutools solutions for many sheets.
When choosing a solution, consider the size of your workbook, frequency of the operation, and need for automation or simplicity. Always double-check which worksheets remain visible to avoid hiding important data unintentionally.
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