Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
546 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
You may be aware of VeryHidden sheets in VBA, See the tip for Very Hidden sheets
Did you know you can use this feature with a VBA event to hide sheets for certain users when they open a workbook?
In the VB Editor, double click ThisWorkbook to see its code.
You should now see the code window.
From the left-hand dropdown at the top of the screen choose Workbook.
The default event for a workbooks, Workbook_Open() will appear.
The code contained within this subroutine will be triggered when the workbook is opened.
As with all VBA event subroutines, you should not edit the name.
You can use the code below to test the username of the logged on user and set the visibility of a worksheet. You can replace trainee with your own Windows username.
Code added to the Workbook_Open event will be triggered when the workbook is opened.
Save the file as a macro-enabled workbook using the .xlsm file extension and then close it.
When I open the workbook, Sheet1 will be visible providing I'm logged on to Windows as trainee.
When logged on as trainee, Sheet1 is visible.
To test this example I can change the user name to be tested to something other than the logged on user name.
I've used "unknown" as the user name for the test.
When I open the workbook, Sheet1 should be hidden and, because I've used VeryHidden, I can only make it visible in the VB editor.
Sheet1 is hidden and I don't have the option to Unhide!
You could simply add more users to the test by using an OR operator.
You can learn more about this topic on the following Wise Owl courses:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2025. All Rights Reserved.