+ Reply to Thread
Results 1 to 5 of 5

Referencing defined names in different cells

  1. #1
    Registered User
    Join Date
    10-09-2009
    Location
    Cambridge, MA
    MS-Off Ver
    Excel 2003
    Posts
    61

    Referencing defined names in different cells

    Hello,

    I would like to use a defined name in a function, but I would like the function to reference a cell that has the name in it as opposed to putting the name in the function (e.g. if cell A2 has the name I have defined, I want the function to reference cell A2 and act like it normally would if I just placed the name in the function).

    I have different names that look up different workbooks (2Q2009, 3Q2009, etc.) Each row in my sheet will look up a different workbook, and I just want to be able to drag the formula down the rows and have it look up the correct name, instead of having to go into every row and change the name in the function. So, I want to be able to list all the names on one worksheet and have the functions adjust the name in the function correspondingly. So, dragging the formula down will put in the name in A2, then the different name in A3, than the different name in A4, etc.

    Is there anyway to reference names instead of putting the name in the formula?

    I apologize for the post being so convoluted. Please let me know I can clarify my issue any further. Thank you!

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Referencing defined names in different cells

    I think you probably want

    =INDIRECT(A2)

    etc.

  3. #3
    Registered User
    Join Date
    10-09-2009
    Location
    Cambridge, MA
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Referencing defined names in different cells

    Maybe I'm not using it right, but I get a "#REF!" when I try to use indirect. All I have in the cell is the defined name, without " " or anything, but indirect doesn't return anything. Even when I just put =indirect(namecontainingcell), I get a REF.

    Thanks.

  4. #4
    Registered User
    Join Date
    10-09-2009
    Location
    Cambridge, MA
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Referencing defined names in different cells

    The name references an unopened workbook. That might be why I get REF. But the workbook needs to be closed. So, is there another way around this?

  5. #5
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Referencing defined names in different cells

    INDIRECT doesn't work for closed workbooks. Why do they have to be closed? I suppose you could do it with code, or you could open the workbooks.

    Perhaps somebody else will have a bright idea.

+ 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