Link to home
Start Free TrialLog in
Avatar of Tim
TimFlag for United States of America

asked on

Merge a duplicate row based on the data of one column.

Dear Excel/VB Experts,

I am trying to right a macro in Excel that will help cleanup the duplicates in my workbook. I have some rows with a duplicate field and would like to have the first occurrence of the duplicate deleted and replaced with the second along with all the fields after it.

For example:

(before)
name phone email address
someone       11111111     hbdfk@        
                                       hbdfk@         12 jjj ave
Someonelse   33333333     dsds@          
                                        dsds@          23 jjj blvd

(after)
name phone email address
someone       111111111   hbdfk@        12 jjj ave
someoneelse  333333333   dsds@         23 jjj blvd

Is this possible??

Thanks in advance.
Avatar of Ardhendu Sarangi
Ardhendu Sarangi
Flag of United States of America image

Hi,
couple of questions -

1. are the duplicate entries listed in consecutive rows in the file?

2. What is the key (field) used to identify duplicate records?

Can you please post a sample sheet?

thanks,
Ardhendu
Avatar of Tim

ASKER

Yes and yes.

The field is "CX."

Thanks.
Sample.xlsx
Avatar of Tim

ASKER

Here is the desired outcome of that sample sheet.
Sample-of-Desired-Outcome.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Ardhendu Sarangi
Ardhendu Sarangi
Flag of United States of America 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 Tim

ASKER

Thanks that worked fine!
Avatar of Tim

ASKER

Hi, could you help me understand why the For n = 1 To 110 is there?
n = 1 thru 110 denotes the number of columns that you have with data. if the number of columns are more, then 110 will increase accordingly.
Avatar of Tim

ASKER

Oh I see. Thank you sir. What about the 65536? if you don't mind.