Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("A1") = 1 Then
ActiveSheet.Unprotect
Range("B1").Locked = False
Else
If Cells.Locked = True Then
Exit Sub
Else
Cells.Locked = True
ActiveSheet.Protect
End If
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address <> "$A$1" Then Exit Sub
'only look for changes in A1
Me.Unprotect password:="bob"
Select Case Range("A1").Value
Case Is = 1: Range("B1").Locked = False
Case Else: Range("B1").Locked = True
'if A1=1 then B1 is unlocked, otherwise its locked
'(set to locked in Workbook_Open if you want to ensure it starts that way)
End Select
Me.Protect password:="bob"
End Sub
tbardoni said:That's fine because I don't know exactly what the OP wants. I'm sure yours is more of what he needs.