Trying to create some VBA code to lock and unlock cell when a button is clicked on. So far this is what I have and nothing is happening:
Anyone know why? Thanks.
VBA Code:
If Range("A1").Locked = True Then
Selection.Locked = False
Selection.FormulaHidden = False
End If
If Range("A1").Locked = False Then
Selection.Locked = True
Selection.FormulaHidden = False
End If
End Sub
Anyone know why? Thanks.