Hiding an Excel worksheet with VBA

calendar_today Asked May 12, 2009
thumb_up 33 upvotes
history Updated April 16, 2026

Question posted 2009 · +19 upvotes

I have an Excel spreadsheet with three sheets. One of the sheets contains formulas for one of the other sheets.

Is there is a way of hiding it that sheet pprogrammatically, which contains these formulas?

Accepted answer +33 upvotes

To hide from the UI, use Format > Sheet > Hide

To hide programatically, use the Visible property of the Worksheet object. If you do it programatically, you can set the sheet as “very hidden”, which means it cannot be unhidden through the UI.

ActiveWorkbook.Sheets("Name").Visible = xlSheetVeryHidden 
' or xlSheetHidden or xlSheetVisible

You can also set the Visible property through the properties pane for the worksheet in the VBA IDE (ALT+F11).

Excel VBA objects referenced (4)

Top excel-vba Q&A (6)

+33 upvotes ranks this answer #6 out of 136 excel-vba solutions on this site — top 4%.