[vba]Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Cells.Count > 1 Then GoTo Skip
Set myRange = Range("C4:C21,E4:E21,G4:G21,I4:I21,K4:K21")
'check only the "in" cells for cleared, check the "out" cells for Out-In < 4
If Not Intersect(Target, myRange) Is Nothing Then
If IsEmpty(Target) And WorksheetFunction.IsEven(Target.Row) Then 'if Target was cleared
Target.Offset(1).Resize(1, 2).ClearContents 'clears 1 row down, 1 row right
End If
If Not IsEmpty(myRange) And WorksheetFunction.IsOdd(Target.Row) Then 'check the time difference
If (Target.Value <= 4 / 24 - Target.Offset(-1).Value) Then
Target.Offset(, 1).ClearContents
Else: Target.Offset(, 1).Value = 0.5 / 24 'if the time > 4 hours, put the lunch 1/2 hr Back
End If
End If
End If
Application.Calculate
Skip:
Application.EnableEvents = True
End Sub[/vba]
Nick, try that in your worksheet change module. I added also that if the time Out-In > 4 that it puts the lunch in to the appropriate cell. Tested a bit, seems to do what you asked for.
Might be a better way! Worksheet events are not my forte.
Cleaned up the code for the missed day buttons/reasons, it clears the 3 necessary cellls when SUA is clicked.