Hello,
I am wanting to write a macro, that can remove all rows that are duplicates, except 1.
Scenario:
I get lists of existing customers from several locations (geographically, and seperate network database's), so I cannot pre-filter the data. I simply copy these entire rows of data, onto one worksheet. I then have a central list which i filter against.
However, usually I am left with a list of 5-10,000 records which are duplicates. Now the duplicate count can be anywhere from 2 to 5 duplicates of the same phone number (that's all I filter against).
Currently I have a column with : =COUNTIF(C:C,C2)>1
I run this on ever row, and then sort the data based on the boolean value.
Now what I need help with, is vba code that could process through all the lines that column G = true, and then scan that entire "section" of numbers, and erase all rows that are duplicates, and only retain 1 copy of each number (the whole row of that number).
The idea I had would be something like, if cell(g) = true, then step through the remaining rows, copy first number to a new worksheet, then erase that row, step to the next row, and check if that number matches any number in the new worksheet, if not, copy that row to the new worksheet, if it is already there, then delete that row.
Here is a sample file of the kind of data that I am talking about :
sample.zip
ANY help, or suggestions on this would be greatly apreciated.
thank you in advance,
Spyrule.
Bookmarks