+ Reply to Thread
Results 1 to 3 of 3

VLookup to a closed workbook which varies with a cell reference

  1. #1
    Registered User
    Join Date
    01-28-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    30

    VLookup to a closed workbook which varies with a cell reference

    Hi all,

    I am trying to make a VLookup which goes and finds data from a closed workbook.

    In my master spreadsheet, "Well Estimates", I ask the user to enter a date. This is cell A1.
    This date has a specific daily report which is in C:\Folder\ for arguments sake.

    The file name is called DRyymmdd.xls where yymmdd is variable based one the year, month and day of the report.

    The range in the daily report from which I want to obtain information for is R4:V57 in sheet "Supplement Report"

    The thing I am looking for is in column 4 of the array. The VLookup looks at the first column based on "IDT 2".

    In cell P1 of "Well Estimates" I have written the following code which automatically updates the above into a path to that range of cells. I think I have done this right:

    ="'O:\Engineering\Kutubu\Production Actuals\Daily Production\"&YEAR($A$1)&"\"&TEXT($A$1,"mmmm")&"\[DR"&TEXT($A$1,"yymmdd")&".xls]Supplement Report'!$R$4:$V$57"

    Which returns:
    'O:\Engineering\Kutubu\Production Actuals\Daily Production\2009\November\[DR091127.xls]Supplement Report'!$R$4:$V$57

    Next, I tried to write the vlookup:

    VLOOKUP("IDT 2", INDIRECT(P1), 4, FALSE)

    But I get a #REF because the worksheet is not open.

    Is there any way around this from what I have mentioned above?

    Thank you

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: VLookup to a closed workbook which varies with a cell reference

    INDIRECT doesn't work on closed workbooks. You've discovered that. If this is a MUST, then you'll have to install more functionality into your Excel program. Only people with the same installed ADD-IN will be able to use your sheet.

    The ADD-IN is called MoreFunc...read all about it here:
    http://xcell05.free.fr/morefunc/english/

    Download and install it from here:
    http://download.cnet.com/Morefunc/30...-10423159.html

    Go into TOOLS > ADDINS and activate MoreFunc.

    Now you have many, many new functions available to you. Any place you used INDIRECT, now use INDIRECT.EXT instead and it will work on closed workbooks.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: VLookup to a closed workbook which varies with a cell reference

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1