kuldeepjainesl
Member
Hello, I have a piece of code to prevent the duplicate data entry in excel worksheet. this code is clearing the content of the cell where the duplicate value is being found but I need to clear the content of this row.
Actually i get a file from contextures which suits to my requirement if it can prevent adding the duplicate data by checking the C coloum. file is attached. Please let me know what is the easiest way to achieve this.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 Then
If Evaluate("Countif(c:c," & Target.Address & ")") > 1 Then
MsgBox Target.Value & " is a duplicate entry. It will be removed.", vbExclamation, "Data Entry Editor"
Range(Target.Address).ClearContents
End If
End If
End Sub
Actually i get a file from contextures which suits to my requirement if it can prevent adding the duplicate data by checking the C coloum. file is attached. Please let me know what is the easiest way to achieve this.