Hello whitebalance,
There a several methods you can use to do this. This macro uses the Dictionary object to store only the unique entries. Any duplicates will have the entire row cleared. Afterward, the remaining data is sorted in ascending order to remove the blank rows.
Sub DeleteRepeats()
Dim Cell As Range
Dim DSO As Object
Dim Key As String
Dim Rng As Range
Dim RngEnd As Range
Set Rng = Range("D1")
Set RngEnd = Cells(Rows.Count, Rng.Column).End(xlUp)
Set Rng = IIf(RngEnd.Row < Rng.Row, Rng, Range(Rng, RngEnd))
Set DSO = CreateObject("Scripting.Dictionary")
DSO.CompareMode = vbTextCompare
For Each Cell In Rng
Key = Trim(Cell.Text)
If Not DSO.Exists(Key) Then
DSO.Add Key, 1
Else
Cell.EntireRow.ClearContents
End If
Next Cell
Rng.Sort Key1:=Rng.Cells(1, 1), Order1:=xlAscending, Header:=xlGuess, _
MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortTextAsNumbers
Set DSO = Nothing
End Sub
Bookmarks