VBA – Hide (or Unhide) a Worksheet

Associated Files Download Links

This tutorial will teach you how to hide and unhide Worksheets with VBA

Hide Sheet in VBA

To hide a Sheet in VBA, use the worksheet Visible property.

Either set the Visible property to FALSE:

or set the Visible property to xlSheetHidden:

This is the same as if the user right-clicked the worksheet tab and selected “hide”.

vba hide sheet

Unhide Sheet

To unhide a Sheet in VBA, use the worksheet Visible property:


Hidden Sheets can be seen by right-clicking in the Worksheet tab area:

vba unhide sheet

Very Hidden Sheets

The Sheet Visible property has a third option: xlSheetVeryHidden:

Worksheets(“Sheet1”).Visible = xlSheetVeryHidden

Very hidden Sheets are hidden when right-clicking in the Worksheet tab area:

vba very hidden sheet

This code will prevent the spreadsheet user from seeing the Worksheet tab at the bottom of the screen. It also hides the Worksheet from the user when they right-click the tabs at the bottom. The only way to see that the Worksheet exists (or unhide the Worksheet) is by opening the Visual Basic Editor.

Unhide Very Hidden Sheets

Very hidden Worksheets are made visible just like regular hidden Worksheets:


Hide / Unhide Sheets in the VBA Editor

You can also toggle the Worksheet Visible property within the VBA Editor:

vba visible property


Hide All Worksheet Tabs

You might also want to hide the Worksheet Tab area altogether to prevent the user from navigating to different worksheets. Learn more about hiding worksheet tabs.

VBA Coding Made Easy

Stop searching for VBA code online. Learn more about AutoMacro – A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users!

alt text


Learn More!

<<Return to VBA Examples

Did you find this VBA tutorial useful? Then share it with your friends and colleagues:

You may also like some of this related content...

ActiveWindow.Zoom You can use VBA to change the Zoom of a worksheet. Here's code to
Macros applied to an entire workbook can be handy for extracting data from multiple sheets
The following macro loops through every sheet in a workbook and writes the tab name
The following routine will sort the sheets in a workbook alphabetically. The flag “Sort_Mode_Descending” can
This article will discuss the ActiveSheet object in VBA. It will also discuss how to