Hello, I am trying to change the value in a cell only if the worksheet is protected, but I can't seem to find the correct syntax. The code is as follows
I don't want excel to attempt to write the value in the locked cell when the sheet is protected and cause an error.
Thanks
Code:
If [Worksheet g is not protected] Then
g.Cells(1, 3).Value = 1
End If
I don't want excel to attempt to write the value in the locked cell when the sheet is protected and cause an error.
Thanks