Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Target.Address = "$C$7" Then
With Target
If .Value = "" Then
On Error GoTo 0
Exit Sub
End If
If Not ((.Value < 1 And Format(.Value, "00:00:00") Like "##:##:##") Or LCase(.Value) = "absent") Then
Application.EnableEvents = False
MsgBox "Wrong input, try again", vbOKOnly
Target.Value = ""
Application.EnableEvents = True
End If
End With
End If
On Error GoTo 0
End Sub
You also need to make sure the cell value is not less than 0.Hi
You can use Conditional formatting on the actual cell:
=OR(A1<1;A1="Absent")
First color the cell red, then in Conditional Format use "No Fill".
Vidar