At the end of the running of my VBA code, I want to protect the entire Worksheet except for cell A1.
At the beginning of the code I have:
Set WSInput = Worksheets("Input")
Set WSInputA1 = Worksheets("Input").Range("A1:A1")
WSInput.Unprotect
And at the end of the run I have:
WSInput.Protect
WSInputA1.Locked = False
The last line (WSInputA1.Locked = False) gets a Run-time error '1004': Unable to set the Locked property of the Range class
At the beginning of the code I have:
Set WSInput = Worksheets("Input")
Set WSInputA1 = Worksheets("Input").Range("A1:A1")
WSInput.Unprotect
And at the end of the run I have:
WSInput.Protect
WSInputA1.Locked = False
The last line (WSInputA1.Locked = False) gets a Run-time error '1004': Unable to set the Locked property of the Range class