Forum Discussion
Frank Drucker
Aug 11, 2020Copper Contributor
Macro to Include Password
I want to create a macro that will protect and unprotect a sheet with a password. I tried to "record" a macro that had a password but the resulting macro had none.
- Aug 11, 2020Sheets("sheet1").Select ActiveSheet.Protect Password:="" Sheets("sheet1").Select ActiveSheet.Unprotect Password:="" Change Sheet1 to the name of your sheet. If you want an actual password, place it in the "".
jukapil
Aug 11, 2020MCT
Use below code Sheet1.Unprotect "123" Sheet1.Range("A1").Value = "ABC" Sheet1.Protect "123" where 123 is password, so just replace it.