Align similar worksheet in preparation for merge

johnmeyer

New Member
Joined
Oct 23, 2011
Messages
46
Office Version
  1. 2007
Platform
  1. Windows
I have a typical contact database, which includes address, phone, email, etc.

I then have a separate database which contains only the contact names (last,first) and new, updated emails. I want to update the contact database with these new emails.

However, there are a few problems ...

If you look at the example below, the first three columns (A,B,C) shows an excerpt from the contact database; the next three columns (E,F,G) shows the new emails. What I want to do is move down the rows in this email database, so they match the rows in the contact database. The final three columns (I,J,K) demonstrates what I am trying to achieve.

As you can see, the email list is a much smaller list than the main contact database, with many names missing. Another problem is that the first names are sometimes abbreviated.

Also note that the database can have people with the identical name (both first and last), but different emails. Thus, once the first instance is matched, it is important that the code which does the alignment "keep on moving" so that the next line gets used. If a few lines end up in the wrong place, that's OK, because it can be sorted out when I do the highlighting. I just don't want to have any lines missing.

My ultimate goal is to add a new column in the original database (column D), and put the new email address in that column, but only if it is different than the existing address. Once I have verified the changes, I can easily merge those into column C.

Thanks in advance for any and all help!

Em1
A
BCDEFGHIJK
1Original Database


New Email Addresses


New Email Addresses moved to match original names

2










3Last_NameFirst_Name
Email
Last NameFirst NameEmail
Last NameFirst NameEmail
4AbaxDandxyz@mary.com
AbaxDanieldxyz@mary.com
AbaxDanieldxyz@mary.com
5AcherBrianabc@xyz.com
AcherBrianabc@xyz.com
AcherBrianabc@xyz.com
6AdamJohn

AdamsMarynewemail@abc.com



7AdamsMary

AlexanderMaxanotheremail@aol.com
AdamsMarynewemail@abc.com
8AlexanderMaxmyemail@yahoo.com
AlexanderMaxmyemail@yahoo.com
AlexanderMaxanotheremail@aol.com
9AlexanderMaxanotheremail@aol.com
AlabamaSuzyhi@aol.com
AlexanderMaxmyemail@yahoo.com
10AlabamaSuzyhi@aol.com
AllenNancyfriendly@abc.com
AlabamaSuzyhi@aol.com
11AllenNancyfriendly@abc.com
AmishPeggymymail@compuserve.com
AllenNancyfriendly@abc.com
12AmanGeorge








13AmishPegmymail@compuserve.com




AmishPeggymymail@compuserve.com
14AnadobeBob








15AndersLarry









<tbody>
</tbody>
Excel 2002
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Wow, that is so close to what I wanted that it looks like it was written just for me. Many thanks!!
 
Upvote 0
You're welcome, I'm glad it helped.
 
Upvote 0
Spoke too soon. The workbook is password protected, so I cannot get to the code.

[edit] Well, the part that is protected doesn't matter. I found out how to get to the code.
 
Last edited:
Upvote 0
I never password-protect workbooks, worksheets, or VBA projects -- it would defeat the purpose of posting in a forum.

I did just upload an xlsm version, though -- it's at the same link.
 
Upvote 0
Sorry, I was being "thick." The "Mr. Excel" HTML code is password protected. I clicked on that module in the VBA editor and got the error message. My bad.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top