+ Reply to Thread
Results 1 to 6 of 6

How to convert text to a path

  1. #1
    Registered User
    Join Date
    04-22-2011
    Location
    Schenectady, New Yrok
    MS-Off Ver
    Excel 2003
    Posts
    4

    How to convert text to a path

    What I am attempting to do is to have a cell with a value that I change then have a formula, macro or visual which would use this cell value to generate a path to a file to retrieve the value I want. If the value entered into the cell is 2910 then I would want to generate a path such as 'S:\Budget\Agency Budget\2011-12\[My 2910.xls]2910 FS'!$B$4. If I change the value in the cell to 1910 I would want the path to change to 'S:\Budget\Agency Budget\2011-12\[My 1910.xls]1910 FS'!$B$4 and pull that cell from that sheet. I am starting to think that this may be something I need to do in visual basic or macros but I am still holding out hope that I can do this without that. Let me know if you need any more information from me. THANKS!!!
    Last edited by KINEONAYVA; 04-23-2011 at 01:41 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: How to convert text to a path

    Hello KINEONAYVA,

    Welcome to the Forum!

    In the second example, it looks identical to the first example. Should the second example be this...
    'S:\Budget\Agency Budget\2011-12\[My 1910.xls]1910 FS'!$B$4"
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-22-2011
    Location
    Schenectady, New Yrok
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How to convert text to a path

    The second one should in fact read 'S:\Budget\Agency Budget\2011-12\[My 1910.xls]1910 FS'!$B$4". Sorry for the error. Any ideas?

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: How to convert text to a path

    What you want can be accomplished by one of the following:

    If the file you want to reference is open you can use the INDIRECT() function:

    http://www.excelfunctions.net/Excel-...-Function.html

    BUT if the file(s) will be closed then you'll need the INDIRECT.EXT() function:

    http://www.excelfunctions.net/Excel-...-Function.html

    It is available in a free add-in called Morefunc which is available here:

    http://xcell05.free.fr/morefunc/english

  5. #5
    Registered User
    Join Date
    04-22-2011
    Location
    Schenectady, New Yrok
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How to convert text to a path

    I have tried various permutations of indirect and I cannot make it see the reference when it is varying the path not the rows or columns. Can you give an example of this in a small spreadsheet? Thanks for all of the help!

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: How to convert text to a path

    Have you tried

    =INDIRECT("'S:\Budget\Agency Budget\2011-12\[My "&cell&".xls]"&cell&" FS'!$B$4")

    replace cell with the address of the cell holding the 2910 or 1910

    Basically what you are doing is to enclose everything that remains constant within quotations and the parts that change are the cell addresses holding the values and are preceded and followed by the ampersand.

+ 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