Link to home
Start Free TrialLog in
Avatar of jrh70
jrh70

asked on

How to look info up on another spreadsheet file in Excel

I need to do a price lookup from spreadsheet1 to spreadsheat2.  I need to do this via a macro because I have multiple look ups to do.  Can anyone help?


Spreadsheet1

Product A          $1.99
Product B          $2.09
Product C          $0.99

Spreadsheet2

ProductC
ProductA
ProductB
Avatar of KnutsonBM
KnutsonBM
Flag of United States of America image

i know you said via macro, but a formula would work very well for this, vlookup is designed especially for this =vlookup(a1,'spreadsheet 1'!A:B,2,false) would do the trick

-brandon
ASKER CERTIFIED SOLUTION
Avatar of FernandoFernandes
FernandoFernandes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jrh70
jrh70

ASKER

is there a way to insert a variable while doing a vlookup?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rob Henson
I notice your lookup value on sheet 2 doesn't have the space in like that on the source document. Is that just a type error in your example or is that the case in the real file?

For the lookup to work properly the lookup values have to match.

Cheers
Rob H
Avatar of jrh70

ASKER

yes that was a typeo.  Sorry
did any of these solutions work for you?  
Avatar of jrh70

ASKER

I got it to work with modified code of the above.
Thanks