Copy/paste in based on duplicate value in previous row

S

Sabosis

Hello-

I have a spreadsheet that has some duplicate rows because the phone and faxnumbers, when exported from our system, are not reported within the same record. All of the other information will be the same (customer, items, etc)the only difference will be the phone number & fax number. Columns E & F contain the phone information (Prefix & actual number) and the first record contains the fax info while the second record will be the phone info if duplication exists.

Since both records share a common sequence number, i am trying to create a macro that will look at the sequence number and if it is the same in both rows, then copy the phone number and paste it in a new column next to the fax number. I will keep the original columns for fax info and create new columns for phone info.

Fax prefix would be column E, Fax number would be column F. I have already inserted columns G (Bus Phone prefix) and H (Bus Phone number). The sequence number is in column J.

If rows 3 and 4 were duplicated for this reason, I want to look at J3, and if it is the same value as J4, then copy the values in E4:F4 and paste themto G3:H3 so that I now have the first record which shows both the fax and phone info in one record. i can then delete the second record from the file..

Please let me know how this would be written in code to do this. i appreciate the help.

Thanks

Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top