ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA and Password Protection (https://www.excelbanter.com/excel-programming/404803-vba-password-protection.html)

Todd from Gold River

VBA and Password Protection
 
I would like to protect worksheets with a password using a macro. Recording
the macro does not seem to install the password and the worksheet can be
unprotected. What needs to be added to the VBA code?

Thanks,

Dave Peterson

VBA and Password Protection
 
worksheets("somesheetnamehere").protect password:="topsecret"

Todd from Gold River wrote:

I would like to protect worksheets with a password using a macro. Recording
the macro does not seem to install the password and the worksheet can be
unprotected. What needs to be added to the VBA code?

Thanks,


--

Dave Peterson


All times are GMT +1. The time now is 12:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com