Hi kwaichung
This code will move all duplicates to "Sheet2". It assumes your Column to check is Column A and the Column A has a heading.
To use it push Alt+F11 and go to Insert>Module, then paste in the code. Push Alt+Q to return to Excel and save. Now push Alt+F8, select "MoveDupes" and click run.
Sub MoveDupes()
Dim lLastRw As Long
Dim rMove As Range
lLastRw = Range("A65536").End(xlUp).
Columns(1).EntireColumn.In
Range("A3:A" & lLastRw).FormulaR1C1 = _
"=IF(AND(COUNTIF(R3C[1]:R7
& ",COUNTIF(R2C:R[-1]C,RC[1]
Range("A3:A" & lLastRw) = Range("A3:A" & lLastRw).Value
Set rMove = Range("A3:A" & lLastRw).SpecialCells(xlCe
rMove.Copy Destination:=Sheets("Sheet
rMove.EntireRow.Delete
Columns(1).EntireColumn.De
Set rMove = Nothing
End Sub
If you column is not Column A let me know and I'll adjust it to suit.
Dave
OzGrid Business Applications
www.ozgrid.com
Main Topics
Browse All Topics





by: criPosted on 2001-05-28 at 13:50:52ID: 6130606
Identifying duplicate entries is fairly easy, see http://www.cpearson.com/ex cel/ duplic at.htm#Hig hlightingD uplicates
However for a 200 whopper you deserve a bit more than just general instructions. Therefore:
a) What is your data structure ? Please paste a sample of your dataset.
b) Is this a one time job or a re-occuring house keeping job ?
c) Did you ever record a macro ?