+ Reply to Thread
Results 1 to 4 of 4

Inserting variables within file names

  1. #1
    Registered User
    Join Date
    01-27-2005
    Posts
    31

    Inserting variables within file names

    Not sure if this can be done, but you never know.

    I have a spreadsheet which imports data from various other spreadsheets, using simple formuals like:

    =C:\folder\[spreadsheet.xls]Book1!$Y$12

    However, from time-to-time, I need to change the names of the files, and add in new files.

    So I tried to a formula with something like:

    ="C:\folder\["&A5&"spreadsheet.xls]Book1!$Y$12"

    With A5 containing the change in file name (my spreadsheets would be something like applespreadsheet.xls, orangespreadsheet.xls etc.)

    This of course does not work.

    Does anyone know of a way I could insert a variable as part of the file name?

    Many thanks for your help.

  2. #2
    Bob Phillips
    Guest

    Re: Inserting variables within file names

    The technique used here would be INDIRECTing, but that doesn't work with
    closed workbooks. See http://makeashorterlink.com/?F2993260A for an
    alternative solution, it is VBA but it works.

    --

    HTH

    Bob Phillips

    (replace xxxx in the email address with gmail if mailing direct)

    "kestrel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Not sure if this can be done, but you never know.
    >
    > I have a spreadsheet which imports data from various other
    > spreadsheets, using simple formuals like:
    >
    > =C:\folder\[spreadsheet.xls]Book1!$Y$12
    >
    > However, from time-to-time, I need to change the names of the files,
    > and add in new files.
    >
    > So I tried to a formula with something like:
    >
    > ="C:\folder\["&A5&"spreadsheet.xls]Book1!$Y$12"
    >
    > With A5 containing the change in file name (my spreadsheets would be
    > something like applespreadsheet.xls, orangespreadsheet.xls etc.)
    >
    > This of course does not work.
    >
    > Does anyone know of a way I could insert a variable as part of the file
    > name?
    >
    > Many thanks for your help.
    >
    >
    > --
    > kestrel
    > ------------------------------------------------------------------------
    > kestrel's Profile:

    http://www.excelforum.com/member.php...o&userid=19082
    > View this thread: http://www.excelforum.com/showthread...hreadid=552254
    >




  3. #3
    Registered User
    Join Date
    01-27-2005
    Posts
    31
    Hi, thanks.

    I have tried Laurent Longre's MOREFUNC.XLL using indirect.ext

    Here is my formula
    =INDIRECT.EXT("'C:\folder\["&I2&".xls]Book1!$Y$12")

    However, this returns a #VALUE!

    Is this the correct way to use the formula?

    Thanks

  4. #4
    Bob Phillips
    Guest

    Re: Inserting variables within file names

    No idea I am afraid, I have never used it.

    --

    HTH

    Bob Phillips

    (replace xxxx in the email address with gmail if mailing direct)

    "kestrel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, thanks.
    >
    > I have tried Laurent Longre's MOREFUNC.XLL using indirect.ext
    >
    > Here is my formula
    > =INDIRECT.EXT("'C:\folder\["&I2&".xls]Book1!$Y$12")
    >
    > However, this returns a #VALUE!
    >
    > Is this the correct way to use the formula?
    >
    > Thanks
    >
    >
    > --
    > kestrel
    > ------------------------------------------------------------------------
    > kestrel's Profile:

    http://www.excelforum.com/member.php...o&userid=19082
    > View this thread: http://www.excelforum.com/showthread...hreadid=552254
    >




+ 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