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

vlookup

ResolvedVersion 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:

Create a unique items table from a duplicating table

1. Ensure that your list has column headings
2. Select the entire list
3. From the menu bar, select DATA, FILTER, ADVANCED FILTER
4. Select "Filter the list, in place", and tick the "Unique Records Only" box
5. Click OK, filtered list appears.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.