Sub DeleteDuplicateEntries3()
Dim ChkRng, TestRng As Range, TRVals, rv, rw As Long, colm As Long, n As Long, RedRng As Range
With Selection
ChkRng = .Rows(.Rows.Count)
Set TestRng = .Cells(1).Resize(.Rows.Count - 1, .Columns.Count)
TRVals = TestRng.Value
End With
For Each rv In ChkRng
If Not IsEmpty(rv) Then
For rw = 1 To UBound(TRVals)
For colm = 1 To UBound(TRVals, 2)
If TRVals(rw, colm) = rv Then
TRVals(rw, colm) = Empty
If RedRng Is Nothing Then Set RedRng = TestRng.Cells(rw, colm) Else Set RedRng = Union(RedRng, TestRng.Cells(rw, colm))
n = n + 1
End If
Next
Next
End If
Next
If n > 0 Then
TestRng = TRVals
RedRng.Interior.Color = RGB(255, 0, 0)
End If
MsgBox n
End Sub