vlookup

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VLOOKUP

VLOOKUP

resolvedResolved · 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

Edited on Thu 27 Nov 2008, 14:05

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

RE: VLOOKUP

Thanks Stephen, I will try applying this.
Steven

 

Training courses

 

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
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Wrapping Text in a Cell in an Excel 2010 Workbook

When 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.

View all Excel hints and tips


Server loaded in 0.09 secs.