Link to home
Start Free TrialLog in
Avatar of pdvsa
pdvsaFlag for United States of America

asked on

Delete duplicates - original and duplicate

Experts, I'm looking for VBA code that will delete duplicates but will delete both of them the original and the duplicate. I have a few columns  A through M and the match would need to be for each field not just one field and if a match on all those fields then delete both records.

Thank you very much.
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Please supply a sample workbook.
A through M and the match would need to be for each field not just one field and if a match on all those fields then delete both records

the approach I'm thinking of would be:

1) to add an additional column after last column, which will be counting and determine whether such row is a "duplicate" row.

2) and then use that as an indicator to determine if a row should be deleted or not.

3) once the checking is done, that additional row will be deleted as well.
Avatar of pdvsa

ASKER

Hi Martin,
I will have to supply one in the am.  I am not at my computer at the moment, which is where my file is saved.

Ryan, sounds interesting.  I would like to know how a counting of rows could identify duplicates. 
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pdvsa

ASKER

awesome.  Worked perfectly.  Thank you very much!