أخى الفاضل
جرب هذا الكود فى حدث الورقة
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LR As Integer, x As Integer
Dim cl As Range, cll As Range
LR = [A1000].End(xlUp).Row
'==========================================================
If Target.Column <> 1 Then Exit Sub
For Each cl In Range("B1:B" & LR)
If cl = "نهاية خدمة" Then x = cl.Offset(0, -1).Value
For Each cll In Range("A1:A" & LR)
If Application.WorksheetFunction.CountIf(Range(Cells(cl.Row, 1), Cells(LR, 1)), x) > 1 Then
MsgBox "هذا الموظف حصل على نهاية خدمة قبل ذلك ولا يمكن تكراره": Target = "": Target.Select: Exit Sub
End If
Next
Next
End Sub
عدم تكرار شرط.rar