Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
ActiveSheet.Unprotect
If Not Intersect(Target, Columns("A")) Is Nothing Then
On Error Resume Next
For w = 1 To Range("A" & Rows.Count).End(xlUp).Row
If Range("A" & w) = "" Then
Range("A" & w).Locked = False
Range("O" & w).Locked = False
Else
Range("A" & w).Locked = True
Range("O" & w).Locked = True
End If
Next
End If
ActiveSheet.Protect
End Sub