Excel - A macro to fill in data automatically


I have two worksheets in Excel 2007 and am trying to automatically fill in cells in the 2nd worksheet two based on values in the first worksheet. Both worksheets contain name, last name, address, phone number (no unique identifiers though). Some of these contact details are repeated in worksheet2. Whenever an identical name (first name, last name) is typed into the second worksheet, I would like the contact details fields in worksheet 2(address, phone number, etc) to be filled automatically. Could anyone help with the code?


Here a small sample of the code:

sheet 1 contains data from A1 to D5  

first name last name address phone no.  
a s sssss 123  
a d ddddd 234  
s d ffffffff 345  
f g gggggg 678  

sheet 2 contains data from A1 to B3  

first name last name  
a d  
f g  

in the second sheet in C2 copy this formula  


copy C2 down and to right.  

you get the results like this  

first name last name address phoneno.  
a d ddddd 678  
f g gggggg 678 

Note that

Solved by venkat1926
Published by aakai1056. Latest update on June 26, 2012 at 05:51 AM by aakai1056.
This document, titled "Excel - A macro to fill in data automatically," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).
One cell two formulas
Find and replace cell value macro