+ Reply to Thread
Results 1 to 6 of 6

Possibly Index? - Reference a workbook using a cell in a current worksheet

  1. #1
    Registered User
    Join Date
    02-01-2014
    Location
    Boston, Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    61

    Possibly Index? - Reference a workbook using a cell in a current worksheet

    I am looking to roll-up a lot of information by referencing multiple workbooks and specific cells and I believe I have done this before using INDEX() but it has been a long time.

    As an Example Column A has the file's name it should look at, Column B has the tabs name it should look at, Column C has the cell location that should be referenced.

    As it currently stands the direct formula is =[chicagotest.xlsx]sheet!D5. I have 40 workbooks it needs to reference. What formula can read column A (file name), column B (sheet name) and column C (cell location) in other files for me.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Possibly Index? - Reference a workbook using a cell in a current worksheet

    What about the path to the filename? Is that held in a cell somewhere and is it common to all files?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Possibly Index? - Reference a workbook using a cell in a current worksheet

    I suppose you must use INDIRECT

    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    or
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Possibly Index? - Reference a workbook using a cell in a current worksheet

    Unfortunately INDIRECT() won't work with closed workbooks.
    One option would be to iterate through all the file names, open them create the formula and then close the workbook.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Possibly Index? - Reference a workbook using a cell in a current worksheet

    ...one VBA macro that seems to work is the following.

    Assuming the path is common to all files and with the path in say E1
    Please Login or Register  to view this content.
    Change the loop counter end value as necessary or better still use a variable to set it.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Possibly Index? - Reference a workbook using a cell in a current worksheet

    ...one VBA macro that seems to work is the following.

    Assuming the path is common to all files and with the path in say E1
    Filename in column B
    Sheetname in column C
    cell ref in column D

    Please Login or Register  to view this content.
    Change the loop counter end value as necessary or better still use a variable to set it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Reference an unopened workbook to vlookup date into the current workbook
    By forrestgump1980 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-15-2016, 07:03 AM
  2. Replies: 1
    Last Post: 11-09-2015, 09:30 PM
  3. Replies: 1
    Last Post: 04-02-2015, 11:46 AM
  4. [SOLVED] Reference cell on another worksheet based on value on current sheet
    By clocke in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-19-2014, 12:24 PM
  5. [SOLVED] Need to reference a cell in a different worksheet in the same workbook
    By igor7 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-18-2013, 04:18 AM
  6. [SOLVED] Reference Cell in current workbook whilst using Camera Tool
    By RichTea88 in forum Excel General
    Replies: 3
    Last Post: 07-17-2013, 08:55 AM
  7. Replies: 0
    Last Post: 09-22-2005, 12:05 PM

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