Sort
Profile photo for Brian Baulsom MNFSH
  1. For Each s In ActiveWorkbook.Worksheets 
  2. If s.Name <> ActiveSheet.Name Then 
  3. s.Visible = xlSheetVeryHidden 
  4. End If 
  5. Next 
Profile photo for Laura Christina Warren

Thank you for the A2A. You can hide all of the sheets except the active one by copying the following code into your Visual Basic Editor.


  1. Sub HideAllSheets() 
  2. Dim ws As Worksheet 
  3. For Each ws In ThisWorkbook.Worksheets 
  4. If ws.Name <> ActiveSheet.Name Then ws.Visible = xlSheetVeryHidden 
  5. Next ws 
  6. End Sub 

When you call this macro, the routine sets up a For loop that will go through each sheet in the wor

Thank you for the A2A. You can hide all of the sheets except the active one by copying the following code into your Visual Basic Editor.


  1. Sub HideAllSheets() 
  2. Dim ws As Worksheet 
  3. For Each ws In ThisWorkbook.Worksheets 
  4. If ws.Name <> ActiveSheet.Name Then ws.Visible = xlSheetVeryHidden 
  5. Next ws 
  6. End Sub 

When you call this macro, the routine sets up a For loop that will go through each sheet in the workbook with a name that is not equal to the active sheet name and assigns to it the very hidden attribute.

You can modify this code to unhide all of the sheets. Copy the following code into the Visual Basic Editor.

[code]Sub UnhideAllSheets(...

Trade Like a Pro with IBKR: Invest in Global Stocks, Options, Futures & More! Your capital is at risk.
Profile photo for Assistant
Assistant

To make all sheets except the active sheet in an Excel workbook very hidden (which means they cannot be made visible through the Excel interface), you can use VBA (Visual Basic for Applications). Here’s how you can do this:

Steps to Make Sheets Very Hidden

  1. Open the Excel Workbook: Open the workbook where you want to hide the sheets.
  2. Open the VBA Editor:
    - Press
    ALT + F11 to open the Visual Basic for Applications editor.
  3. Insert a New Module:
    - In the VBA editor, right-click on any of the objects for your workbook in the Project Explorer.
    - Select
    Insert > Module. This will create a new mod

To make all sheets except the active sheet in an Excel workbook very hidden (which means they cannot be made visible through the Excel interface), you can use VBA (Visual Basic for Applications). Here’s how you can do this:

Steps to Make Sheets Very Hidden

  1. Open the Excel Workbook: Open the workbook where you want to hide the sheets.
  2. Open the VBA Editor:
    - Press
    ALT + F11 to open the Visual Basic for Applications editor.
  3. Insert a New Module:
    - In the VBA editor, right-click on any of the objects for your workbook in the Project Explorer.
    - Select
    Insert > Module. This will create a new module.
  4. Add the VBA Code:
    - Copy and paste the following code into the module:

```vba
Sub HideOtherSheets()
Dim ws As Worksheet
Dim activeSheetName As String

  1. activeSheetName = ActiveSheet.Name 
  2.  
  3. For Each ws In ThisWorkbook.Worksheets 
  4. If ws.Name &lt;&gt; activeSheetName Then 
  5. ws.Visible = xlSheetVeryHidden 
  6. End If 
  7. Next ws 

End Sub
```

  1. Run the Code:
    - Close the VBA editor.
    - Press
    ALT + F8 to open the Macro dialog box.
    - Select
    HideOtherSheets and click Run.

Explanation of the Code

  • The code defines a subroutine called HideOtherSheets.
  • It retrieves the name of the currently active sheet.
  • It loops through all worksheets in the workbook, checking if the name of each sheet is different from the active sheet.
  • If it is different, it sets the visibility of that sheet to xlSheetVeryHidden.

Unhiding Very Hidden Sheets

To make the sheets visible again, you can use the following code in the same or a different module:

  1. Sub UnhideAllSheets() 
  2. Dim ws As Worksheet 
  3.  
  4. For Each ws In ThisWorkbook.Worksheets 
  5. ws.Visible = xlSheetVisible 
  6. Next ws 
  7. End Sub 

Important Notes

  • Saving the Workbook: Make sure to save your workbook as a macro-enabled file (.xlsm) to retain the VBA code.
  • Accessing Very Hidden Sheets: You cannot unhide very hidden sheets through the Excel interface; you must use VBA to change their visibility back to visible.

This approach effectively hides all sheets except the one you are currently working on!

Profile photo for Greg Lovern
  1. Dim sh As Worksheet 
  2. For Each sh In ThisWorkbook.Worksheets 
  3. If Not sh Is ActiveSheet Then 
  4. sh.Visible = xlSheetVeryHidden 
  5. End If 
  6. Next sh 
Profile photo for Ronald 'Ron' J. Ellis
  1. Begin by pressing and holding the [Ctrl] key while selecting the sheets to be hidden. In the sample ‘Sheet1’ and ‘Sheet2’ were selected (See ‘A’ and ‘B’ below).
  2. Right-click on the already selected sheet names (Again ‘A’ or ‘B’) and choose the [Hide] command (See ‘C’).
  3. The result is as shown below (See ‘D’)

HINT: To remove the hidden sheets right-click on a remaining sheet and choose the [Unhide] command (See ‘E’ and ‘F’)

  1. Begin by pressing and holding the [Ctrl] key while selecting the sheets to be hidden. In the sample ‘Sheet1’ and ‘Sheet2’ were selected (See ‘A’ and ‘B’ below).
  2. Right-click on the already selected sheet names (Again ‘A’ or ‘B’) and choose the [Hide] command (See ‘C’).
  3. The result is as shown below (See ‘D’)

HINT: To remove the hidden sheets right-click on a remaining sheet and choose the [Unhide] command (See ‘E’ and ‘F’)

Profile photo for Greg Davis

Not sure what you mean by "very hidden". Right click any tab and select hide and the sheet disappears. Repeat for all tabs you don't want to see. You can also click on one tab and shift click on the last tab and hide a whole set of tabs at once (or control click the other tabs if they are not next to each other). The only tab(sheet) left open has to be the active one (you can't hide the all sheets, one has to be left unhidden).

Profile photo for M. Tithveasna

You can do with VBA.

Sub HideSheets ()

Dim sht As Worksheet

For Each sht in ThisWorkbook.Worksheets

If sht.Name<>Activesheet.Name Then

sht.Visible=False

Next

End Sub

Profile photo for Richard Harker

You’ll need to go into the Visual Basic editor to make sheets very hidden. You can hide sheets and then protect the workbook so that users would need a password to unlock it and then I hide the sheets. To make it very hidden you open the VBE select a sheet from the project explorer window then go to properties and change the visible property to 2 - xlSheetVeryHidden. The sheet will become hidden i

You’ll need to go into the Visual Basic editor to make sheets very hidden. You can hide sheets and then protect the workbook so that users would need a password to unlock it and then I hide the sheets. To make it very hidden you open the VBE select a sheet from the project explorer window then go to properties and change the visible property to 2 - xlSheetVeryHidden. The sheet will become hidden in the workbook and the unhide option will be greyed out. Of course if people realise you’ve done this and know where to go they can change it bac...

About · Careers · Privacy · Terms · Contact · Languages · Your Ad Choices · Press ·
© Quora, Inc. 2025