"Run-time error '1004':
Unable to set the Locked property of the Range class
Continue | End | Debug | Help"
^ Happens regardless if I select "Yes" or "No".
Still able to edit A2 after selecting "No" and locking the sheet.
Both A1 and A2 are unlocked cells.
After I select Debug, the arrow points to:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
If Range("A1").Value = "No" Then
Range("A2").Value = 0
Range("A2").Locked = True
Else
Range("A2").Value = ""
Range("A2").Locked = False
End If
End If
End Sub