+ Reply to Thread
Results 1 to 14 of 14

INDIRECT update with external workbook

  1. #1
    Registered User
    Join Date
    05-02-2008
    Posts
    18

    INDIRECT update with external workbook

    Hello,

    Is it possible for the INDIRECT function to be tweaked so it updates even when the external workbook is closed?

    Also does anyone have any idea why
    Please Login or Register  to view this content.
    Produces a #REF! error code?


    Any help would be greatly appreciated :D

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    See if links help

    http://www.dailydoseofexcel.com/arch...sed-workbooks/
    http://www.j-walk.com/ss/excel/tips/tip82.htm
    http://www.contextures.com/xlFunctions05.html#RefWkbk

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You could download and install a free Morefunc.dll addin from here: http://xcell05.free.fr/english/ and use the Indirect.ext function

    =INDIRECT.EXT("C:\Documents and Settings\*****\Desktop\Excel[book2.xls]Sheet1!C"&C2)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    05-02-2008
    Posts
    18
    I've used the INDIRECT.EXT function and it works brilliantly. But ideally, I need to get it to work without installing add-in's into excel

    Is there any other way to do this?

    Also any feedback on the reason why my INDIRECT ^^^ function isn't returning a result with the filename?

    Thanks!

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by papa_face
    ...

    Also any feedback on the reason why my INDIRECT ^^^ function isn't returning a result with the filename?

    Thanks!
    should there be another \ after EXCEL?

  6. #6
    Registered User
    Join Date
    05-02-2008
    Posts
    18
    I tried:
    Please Login or Register  to view this content.
    It gave me:
    Please Login or Register  to view this content.
    But
    Please Login or Register  to view this content.
    works.
    I need it to use a full path to gain access to the file.

    But having said that, INDIRECT is only meant to use open workbooks so it would never need the FULL path, just the sheet name.

    Is there any other way of referencing a cell dynamically, like I have done in the above code, but so it will update automatically without the workbook open?

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    How about:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-02-2008
    Posts
    18
    Quote Originally Posted by NBVC
    How about:

    Please Login or Register  to view this content.
    Still produces #REF!

    What I am trying to do is this:
    Please Login or Register  to view this content.
    But as you can see that isn't dynamic.

    Strictly speaking I would like it to be:
    Please Login or Register  to view this content.
    But excel won't allow me to do that, which is why I needed to use INDIRECT.

    This is a screenshot of what I am trying to do:
    http://img514.imageshack.us/img514/8...anationcx1.jpg

    As you can see I can easily generate the row number I am looking for. Row 16 for speakers on book2 for example.

    I need a way of finding the value using the row number dynamically.

    Any suggestions?

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Well if the workbook is open and the path is correct, including the spelling of all folders, sheets, etc... then I can't see why it doesn't work.. the syntax looks fine to me...

  10. #10
    Registered User
    Join Date
    05-02-2008
    Posts
    18
    I don't think INDIRECT is designed to use full path names as there is no need for it to, as its intended purpose is to ONLY gather data from open workbooks.

    Do you have any suggestions of a way around to do what I need?

    Basically I just need a way of finding the value of data in a given cell (is calculated in my sheet already) and column.

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    oddly enough, Indirect will work with the whole path... it's just that the workbook has to be opened.....

    anyways, maybe you can use Vlookup?

    Something like:

    Please Login or Register  to view this content.
    This will look up the item from B2 in column A of the other workbook and pull the data from column C in the same row...

    Vlookup does work on closed workbooks

    copied down

  12. #12
    Registered User
    Join Date
    05-02-2008
    Posts
    18
    That works pretty well

    Is there any way to adapt that so it can tell it to look in a particular cell?

    As with
    Please Login or Register  to view this content.
    It would not allow me to put in new columns which is probably going to happen...

    I ideally need a way to telling the function to look at a cell to get the row number and insert it into the function.
    Like:
    C2 = 3

    Function:
    Please Login or Register  to view this content.
    is interpretted as:
    Please Login or Register  to view this content.
    Which is what indirect does, but obviously that doesnt work the way I want it to.

    Thanks for your help so far by the way :D
    Last edited by papa_face; 05-02-2008 at 04:18 PM.

  13. #13
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    The only other thing I can suggest is the Index() function...

    e.g. =INDEX([book2.xls]Sheet1!A:D,C2,2)

    syntax: INDEX(array,row_num,[col_num])

    This function looks at the table range [book2.xls]Sheet1!A:D and extracts the item in the row identified by cell C2 and from column 2.

    So if you have a 3 in cell C2, it will extract the item in B3 of [book2.xls]Sheet1.

  14. #14
    Registered User
    Join Date
    05-02-2008
    Posts
    18
    Thanks :D
    Thats more practical than the VLOOKUP function for the intended use, as if the row position changed I would have to edit every single formula. But I can easily reference a column number in a cell and make it change them all :D

    Thanks for your help!

+ 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