Hello my Dears ... I Want Your help To Correct this Code to do well ,this Code To Prevent Duplicat Entry In Three Columns ( B,C,D) and please Note Two Columns Have DropDown List
and some time , i have two Differant Guides In the same Date and the Same Trip
For example, the row colored red, I cannot enter it in the presence of this code .. But I must be able to enter it because this guide’s trip on this date is not repeated
and some time , i have two Differant Guides In the same Date and the Same Trip
For example, the row colored red, I cannot enter it in the presence of this code .. But I must be able to enter it because this guide’s trip on this date is not repeated
Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 And Target.Column = 3 Or Target.Column = 4 Then
If Application.CountIf(Columns(Target.Column), Target) > 1 Then
MsgBox "Duplicate Entry Not Allowed!", vbCritical
Target.ClearContents
End If
End If
End Sub