Re: Segregating/displaying duplicates
its working fine thanks a lot
Quote from apo;715359Display MoreHi..
Try this..
It loops through Column A.. adding values into the Scripting Dictionary. When it comes across a Value that already exists in the Dictionary.. it puts it in Column B.
Finally.. it removes duplicates in Column B so that al that remains is 1 instance of each value that was a dupe..
CodeDisplay MorePrivate Sub CommandButton1_Click() Dim it, x0 Application.ScreenUpdating = False With CreateObject("scripting.dictionary") For Each it In Sheets("Sheet1").Range("A2:A" & Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row) If .Exists(it.Value) Then Sheets("Sheet1").Range("B" & Sheets("Sheet1").Range("B" & Rows.Count).End(xlUp).Row).Offset(1).Value = it.Value Else x0 = .Item(it.Value) End If Next End With Sheets("Sheet1").Columns(2).RemoveDuplicates Columns:=1, Header:=xlNo Application.ScreenUpdating = True End Sub