Hi All,
How do I protect a specific worksheet (not necessarily the "active sheet") with VB. That particular sheet, I initially protected it using "password" the password. Then I'm trying to unprotect the sheet when the userform is initialized. Then when it's terminated, I want to re-protect it. Here is the code I'm trying to use...
To Unprotect
Private Sub UserForm_Initialize()
Dim PW As String
PW = "password"
Worksheets("Summary").Unprotect Password: PW
End Sub
To Protect (haven't really tested this one, just assuming it's wrong because the other doesn't work.
Private Sub UserForm_Terminate()
Dim PW As String
PW = "password"
Worksheets("Summary").protect Password: PW
End Sub
Can someone help me figure out the correct code? Thanks!
Bookmarks