How to create a macro that compares a list to another list

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can i make this macro check for eksample one collum to another collum.
This is a phone bill that is going to be checked agains a phone book, if some
of the numbers is equal to one of the numbers in the phonebook, it is going
to autofill the name for this nr in the phone bill.
 
Hi,

You don't need to use a macro. You can either use =VLOOKUP or, if you are
getting more than one bit of data from the phonebook, =MATCH and =INDEX.

Suppose the column you have the numbers in the bill in is A and the phone
book is in a range E1:G11, with the phone numbers in the first column, name
in the second and (say) address in the third. Then

=VLOOKUP(A1,$E$1:$G$11,2,FALSE)

would give you the name (if the phone number exists).

Regards,

David Jessop
 
Back
Top