+ Reply to Thread
Results 1 to 6 of 6

Indirect for Workbook Name

  1. #1
    Registered User
    Join Date
    06-16-2008
    Location
    Arlington, VA
    MS-Off Ver
    2007
    Posts
    93

    Indirect for Workbook Name

    Good afternoon,
    Is it possible to use an indirect or similar function to look at different workbooks, as opposed to different tabs?

    I want to be able to type in a workbook name in cell A1 which will tell a formula in B1 to look in the workbook which has the name that was typed into A1. I am familiar with using an indirect reference to accomplish this in searching different tabs within a workbook, however, I cannot figure out how to search through a different workbook.
    This is the indirect that I have been using.

    INDIRECT("'[nms2130.xls]" & $A$1 & "'!$c$27:$iv$27")

    I would like to be able to type in nms2130 into A1 and have the formula in B1 refererence nms2130.xls or if I type nms2131 into A1, B1 references nms2131.xls

    Any help would be greatly appreciated.

  2. #2
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Hi,

    Indirect will only work with open workbooks - will this be a problem?
    Ed
    _____________________________
    Always learning, but never enough!
    _____________________________

  3. #3
    Registered User
    Join Date
    06-16-2008
    Location
    Arlington, VA
    MS-Off Ver
    2007
    Posts
    93

    Indirect

    Yes. I was going to use a macro to open up the workbook, but the file name won't change in the macro will it? Do you have any suggestions?

  4. #4
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    The argument passed to INDIRECT is a string - so as long as you build up the string so that it correctly reflects what the reference would be, then you will have no troubles. So, you an use:

    =INDIRECT("'[" & A1 & ".xls]Sheet1'!A1")

    to refer to the workbook name (without extension) given in A1. As noted before, the target workbook must be open, unless you use some VBA or an add-in like morefunc where you can use the function INDIRECT.EXT which works in exactly the same way as INDIRECT but on closed source workbooks.

    Richard

  5. #5
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Ah, looks like Richard has got in before me - can't argue with his advice.

  6. #6
    Registered User
    Join Date
    06-16-2008
    Location
    Arlington, VA
    MS-Off Ver
    2007
    Posts
    93

    thanks again!

    I appreciate your help.

+ 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. Indirect Variable
    By mycon73 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-21-2008, 12:01 AM
  2. Alternative to INDIRECT with Dependent Lists
    By RDSProgrammer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-05-2007, 03:10 PM
  3. INDIRECT and dynamic ranges
    By inky in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-28-2007, 04:08 PM
  4. Indirect - Building Addresses
    By antedenise in forum Excel General
    Replies: 2
    Last Post: 09-28-2007, 02:15 PM
  5. Indirect Cell in Charts
    By Dave_A in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 05-11-2007, 07:12 AM

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