VBA – Hide (or Unhide) a Worksheet
Make Worksheet Very Hidden
To Make a Worksheet Very Hidden use the following code:
Put this in a module
Sheet1.Visible = xlSheetVeryHidden
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 is by opening the Visual Basic Editor.
Hide a Worksheet
You can also use VBA to make a worksheet hidden, the same as if the user right-clicked the worksheet tab and selected “hide”.
Sub SheetHide ()
worksheets("sheet1").visible = false
Unhide a Very Hidden Worksheet
To unhide the worksheet Put this in a module:
Sheet1.Visible = xlSheetVisible
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!
Did you find this VBA tutorial useful? Then share it with your friends and colleagues: