Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Intersect(Target, Range("B:B")) Is Nothing And _
Intersect(Target, Range("E:E")) Is Nothing Then Exit Sub
ActiveSheet.Unprotect "Password"
Target.Locked = True
ActiveSheet.Protect "Password"
End Sub
Following the same instructions above to unlock cells first, this should do that for you.What if i wanted to protect from let say B1 to h100 . . .also with no password what would code be
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Intersect(Target, Range("B1:H100")) Is Nothing Then Exit Sub
ActiveSheet.Unprotect
Target.Locked = True
ActiveSheet.Protect
End Sub