View Single Post
  #4   Report Post  
Dave O
 
Posts: n/a
Default Looking to create a simple user form with lookup

Good morning, Tim-
Apologies for the delayed response, and thanks for the insight to your
application. I thought you might be in some sort of high-volume
production operation.

Your most efficient/effective solution is likely to be a VLOOKUP. This
formula looks for an exact match of the value in cell A2 in the range
A10:A560, so if there is a typo or a period or a space then the match
will not be found. Let's assume your 3 columns of 551 rows are located
in the range A10:C560, and you want to enter the lookup number in cell
A2. (For aesthetics add headers: A1 = "Card Number", B1= "Company", C1
= "Phone" or some such.) I'll add some additional syntax that will let
you know if the number is not found instead of returning an inscrutable
error.

The formula in cell B2 would be
=IF(ISNA(VLOOKUP(A2,A10:C560,2)),"Card number not
found",VLOOKUP(A2,A10:C560,2))

The formula in cell C2 is
=IF(ISNA(VLOOKUP(A2,A10:C560,3)),"Card number not
found",VLOOKUP(A2,A10:C560,3))