Originally Posted by
czarmir
Could it be possible to return results in new sheet?
Try:
Sub blah()
Set myrng = Range(Cells(1), Cells(Rows.Count, 1).End(xlUp)) 'assumes start in A1 and end bottommost cell with anything in in column A.
'Set myRng = Selection 'use this instead of the line above if you want (select 2 columns of cells before running this macro).
With Sheets.Add(after:=Sheets(Sheets.Count))
.Cells(1).Resize(myrng.Rows.Count).Value = Evaluate("IF(COUNTIFS(" & myrng.Columns(1).Address(external:=True) & "," & myrng.Columns(1).Address(external:=True) & "," & myrng.Columns(2).Address(external:=True) & ",""<>"" & " & myrng.Columns(2).Address(external:=True) & ")>0," & myrng.Columns(1).Address(external:=True) & ","""")")
.Cells(1).Resize(myrng.Rows.Count).RemoveDuplicates Columns:=1, Header:=xlNo
' .Columns(1).AutoFit 'uncomment this line if you want adjusted column width.
' .UsedRange.Sort key1:=.Cells(1), Header:=xlNo 'optional to sort list (additionally any empty cell will go to the bottom of the list).
End With
End Sub
Note various possibilities in comments in the code