98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VLOOKUP
VLOOKUP
Resolved · High Priority · Version 2003
Steven has attended:
Excel VBA Intro Intermediate course
VLOOKUP
Is it possible to use a named range from a separate (but open) workbook in a VLOOKUP fomula? I have done this in the same workbook, but for some reason cannot get it to work when the range is in a separate workbook.
Regards,
Steven
RE: VLOOKUP
Hi Steven
Thankyou for your question
I am assuming you are trying to accomplish this using code.
The following example shows the main principles
strData = application.worksheetfunction.vlookup(Range("a3") ,Range(workbooks("Source").names("MyRange")),3,False)
The key point to note is that the argument specifying the lookup table is
Range(workbooks("Source").names("MyRange"))
This specifies that you are looking at a range defined by the name MyRange in the "source" workbook
Hope this helps
Regards
Stephen
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Wrapping Text in a Cell in an Excel 2010 WorkbookWhen you have a lot of text you want to put in a particular cell but you can't decrease the font size to fit because the text will then become ineligible, then manually wrap the text in a cell by simply pressing ALT+ENTER. |