Select the area to be examined, either manually or by code, and run this code:
Sub RemoveDuplicatesAndRows()
Dim SelectedCells As Range
Dim Cell As Range
Dim Item
Dim i As Long
Dim NoDuplicates As New Collection
Set SelectedCells = Selection
On Error Resume Next
For Each Cell In SelectedCells
NoDuplicates.Add Cell.Value, CStr(Cell.Value)
Next Cell
On Error GoTo 0
Selection.ClearContents
For Each Item In NoDuplicates
i = i + 1
Selection.Cells(i, 1) = Item
Next
End Sub
|