Using dynamic links to external workbooks in Excel

25,436

Use =INDIRECT("'" & DATA & "Stresses'!$C$9").

Share:
25,436

Related videos on Youtube

stray.leone
Author by

stray.leone

SOreadytohelp

Updated on September 17, 2022

Comments

  • stray.leone
    stray.leone over 1 year

    I have a master workbook that needs to pull data from a specific dated subfolder. The date is specified by the user prior to macros being run.

    The master workbook acts only as a presentation layer, and the source/underlying data in the dated subfolders have consistent names and formats.

    Assume that within my master workbook on 'Sheet1' I have the following function in A1:

    ='C:\Development\GridsResults\20101115\[DATA_sheet_20101115_D.xlsx]Stresses'!$C$9
    

    You will notice that are two 'dated' parts in the file link - this needs to be supplied by the user. In this case, the date supplied is 15-Nov-2010. Now if the user supplies 23-Nov-2010, the above link should be

    ='C:\Development\GridsResults\20101120\[DATA_sheet_20101120_D.xlsx]Stresses'!$C$9
    

    I already have a formulae that create the above file paths, within my Links sheet in my master workbook. This is the dynamic part which creates the links. Now in the Links sheet, assume that result of my magic resides in cell B3 and is a named Range called DATA i.e.

    C:\Development\GridsResults\20101120\[DATA_sheet_20101120_D.xlsx]
    

    So in theory, what the outcome should be, is that cell A1 on Sheet1 in my master workbook should use this generated file path

    ="'" & DATA & "Stresses'!$C$9
    

    Is there a combination of standard excel functions that can achieve this?

  • stray.leone
    stray.leone over 13 years
    doesn't the referenced workbook need to be opened to use this?
  • Toc
    Toc over 13 years
    yes it need to be opened
  • Andrea
    Andrea about 10 years
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes or disappears.
  • s3m3n
    s3m3n about 8 years
    And this is such case right now. Domain does not exist.