+ Reply to Thread
Results 1 to 4 of 4

Indirect reference to workbook and worksheet

  1. #1
    Registered User
    Join Date
    01-21-2009
    Location
    Rugby, England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Indirect reference to workbook and worksheet

    I'm a newbie so bear with me while I try to use the forum correctly - thanks

    I am trying to reference a cell (or compare a number of cells) in two different workbooks called "Actuals" and "Budget" each of which has 12 tabs named "Jan" to "Dec". In my new workbook I would like to hold the name of the workbook to be referenced in cell "A1" and the name of the tab in cell "A2".
    ie. A1="Actuals"; A2="Jan".
    For example I would like to reference cell G21 in the tab "Jan" of workbook "Actuals" and compare it with G21 in the tab "Jan" of workbook "Budgets".
    Next month this would be repeated changing the tab to "Feb".

    Hope this all makes sense.
    Thanks

  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: Indirect reference to workbook and worksheet

    The syntax would be:

    =INDIRECT("'[" & $A$1 & ".xlsx]" & $A$2 & "'!G21")

    This creates a text string of the reference pieces, inside the INDIRECT() it is assembled and then the INDIRECT() converts it back to an actual usable reference.

    PROBLEM:
    These formulas will only work if the Actuals.xlsx file is open.
    _________________
    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
    Registered User
    Join Date
    01-21-2009
    Location
    Rugby, England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Indirect reference to workbook and worksheet

    Thanks for excellent advice - has generated another query:
    Can this form of indirect addressing be carried out on a workbook or file that is not open.

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

    Re: Indirect reference to workbook and worksheet

    No, you would have to install additional functionality.

    See here: http://www.excelforum.com/excel-gene...ndirect.html#2

+ 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