You could add the following code to the relevant worksheet's code module:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Const StrPwd As String = ""
With ActiveSheet
If Intersect(Target, .Range("A1:C1")) Is Nothing Then Exit Sub
If .ProtectContents = True Then Exit Sub
If UCase(.Range("B1").Value) = "YES" Then
.Cells.Locked = False
.Range("A1:C1").Locked = True
.Protect Password:=StrPwd, Contents:=True
End If
End With
End Sub
As coded, no password is used. To use a password, simply type it between the "" characters in 'Const StrPwd As String = ""'.