Hi all,

Code:
Sub HighlightDuplicates()
    ' A & B are the columns which we hv to check the duplicate values
    Worksheets("sheet1").Range("A:B").Select
    ' conditional formatting code
    With Selection
        .FormatConditions.AddUniqueValues
        .FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
        .FormatConditions(1).DupeUnique = xlDuplicate
    End With
    With Selection.FormatConditions(1).Font
        .Color = vbRed
        .TintAndShade = 0
    End With
End Sub
Is this correct way to highlight the duplicate entries between the 2 columns