Forum Discussion
egillhelga
Oct 14, 2020Copper Contributor
Have macro run to protect file with encrypted password
I tried to make a macro, by recording a macro, that was supposed to Protect a workbook with an encrypted password when a certain condition was met. The problem is, that it seems not to be able to re...
NikolinoDE
Oct 14, 2020Gold Contributor
Maybe this VBA code will help you to get ahead in your project.
Examble:
Private Sub Worksheet_Change (ByVal Target As Range)
If Range ("F17") <> "Other" Then
With me
.Unprotect "YourPasswort"
.Cells.Locked = False
.Range ("X17: AR18"). Locked = True
.Protect "YourPasswort"
End With
End If
End Sub
I would be happy to know if I could help.
Nikolino
I know I don't know anything (Socrates)