Forum Discussion
JennW_IWCO
Sep 18, 2023Copper Contributor
Disable View Code in Protected Worksheets
I have looked everywhere, but can find no answer to my question. I am using some VBA to dynamically show and hide rows and columns based on selections in my worksheets. In attempting to protect these...
- Sep 18, 2023
Activate the Visual Basic Editor.
Select Tools > VBAProject Properties...
Activate the Protection tab.
Tick the check box 'Lock project for viewing'.
Enter a password in the Password box, and enter it again in the 'Confirm password' box.
Don't forget this password - you'll need it later if you want to view/edit the VBA code!
Click OK.
Save the workbook.
Close and reopen the workbook. You'll find that you cannot view the code if you cannot provide the password.
Warning: this is not 100% tamper-proof. There are ways to disable the password.
JennW_IWCO
Sep 18, 2023Copper Contributor
Thank you so much! This works perfectly. I really appreciate the speedy and helpful response!
HansVogelaar
Sep 18, 2023MVP
You're welcome!