Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Columns("q:q")) Is Nothing Then Exit Sub
If Target.Count <> 1 Then Exit Sub
If Target = "" Then Exit Sub
If Application.WorksheetFunction.CountIf(Range("Q:Q"), Target) <= 1 Then Exit Sub
MsgBox "This invoice number already exists." & vbLf & "Please check and modify.", vbCritical, "WARNING !!!"
Target = "": Target.Select
End Sub