Hiding Sheets as Very Hidden using VBA

MartinS

Active Member
Joined
Jun 17, 2003
Messages
487
Office Version
  1. 365
Platform
  1. Windows
Hi All
Is it possible to set sheets to be very hidden (as is possible within the VBA environment) using VBA code?
Setting the sheets to visible is OK, but users can easily unhide them - I'd like to be able to ensure the user can only see the sheet I want.
Cheers
Martin
 
[FONT=&quot]So here is the code from a macro i created to select a sheet and hide the other sheet (used for navigating from a dashboard to individual sheets, there is a corresponding macro to go back).[/FONT]
[FONT=&quot]Sub gotohoursturnover()
' gotohoursturnover Macro
Sheets("Home").Select
Sheets("Dashboard (Hours & Turnover)").Visible = True
Sheets("Home").Select
ActiveWindow.SelectedSheets.Visible = False[/FONT]

[FONT=&quot]My question is how do i make this statement "ActiveWindow.SelectedSheets.Visible = False" make the sheet very hidden?[/FONT]
[FONT=&quot]I have tried replacing the "false" with "xlSheetVeryHidden" but it just throws up an error.[/FONT]
[FONT=&quot]Yes it may be simple but i am just working out vba lol.[/FONT]
[FONT=&quot]Thanks[/FONT]
[FONT=&quot]Mark[/FONT]
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,215,688
Messages
6,126,213
Members
449,301
Latest member
rcocrane99

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top