Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 And Target.Row > 1 Then Target.Offset(0, 4).Value = IIf(Target.Value = "" Or IsEmpty(Target), Empty, Date)
If Target.Column = 12 And Target.Row > 1 Then Target.Offset(0, 1).Value = IIf(Target.Value = "" Or IsEmpty(Target), Empty, Date)
If Target.Column = 15 And Target.Row > 1 Then Target.Offset(0, 1).Value = IIf(Target.Value = "" Or IsEmpty(Target), Empty, Date)
If Target.Column = 18 And Target.Row > 1 Then Target.Offset(0, 1).Value = IIf(Target.Value = "" Or IsEmpty(Target), Empty, Date)
If Target.Column = 19 And Target.Row > 1 Then Target.Offset(0, 2).Value = IIf(Target.Value = "" Or IsEmpty(Target), Empty, Date + 365)
If Not Intersect(Range("K1:K100"), Target) Is Nothing Then
dl = Range("k100").End(xlUp).Row
If Cells(dl + 1, 11) = "" Then
ActiveSheet.Unprotect
Range("A" & dl & ":K" & dl).Locked = True
ActiveSheet.Protect
End If
If Not Intersect(Range("N1:N100"), Target) Is Nothing Then
dl = Range("N100").End(xlUp).Row
If Cells(dl + 1, 11) = "" Then
ActiveSheet.Unprotect
Range("L" & dl & ":N" & dl).Locked = True
ActiveSheet.Protect
End If
End If
End If
End Sub