+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Change workbook filename in formula.

  1. #1
    Registered User
    Join Date
    12-18-2010
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    9

    Change workbook filename in formula.

    Hi.
    I'm wondering if there is an easy solution to the following "problem":
    Every day I produce about 5-10 new workbooks containing analysis results. Each file is named the same as the analysis number, like X00101.xlsx, x00102.xlsx, etc. I also have one workbook which is a logbook of all analysis I have done, and it contains data from each analysis file. In column A of the logbook I have the analysis number (X00101, etc) and in column B I have the formula =[X00101.xlsx]Sheet1!$B$2. And now to the "problem": Every time I save a new analysis file and I put in the analysis number in column A of the logbook, I would have to manually edit the formula in column B to match the new analysis filename. Is there an easy way to make the formula change automatically? Like if I type X00104 in A6, the formula in B6 should automatically be =[X00104.xlsx]Ark1!$B$2.

    Thanks.
    Last edited by Taste2Bad; 12-21-2010 at 12:42 PM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Change workbook filename in formula.

    Hi,

    Like this?

    ="["&A6&".xlsx]Ark1!$B$2"
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    12-18-2010
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Change workbook filename in formula.

    Quote Originally Posted by sweep View Post
    Hi,

    Like this?

    ="["&A6&".xlsx]Ark1!$B$2"
    Thank you for you reply.
    Your solution will only display the formula as a text in the cell and not execute it.

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Change workbook filename in formula.

    I guess by execute it you mean return the contents of the cell?

    =INDIRECT("["&A6&".xlsx]Ark1!$B$2")

    This will only work if the destination workbook is open. To obtain values from closed workbooks, please do a quick search of the forum, it's a topic of frequent discussion.

  5. #5
    Registered User
    Join Date
    12-18-2010
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Change workbook filename in formula.

    Quote Originally Posted by sweep View Post
    I guess by execute it you mean return the contents of the cell?
    Yes, you guessed correct.
    Quote Originally Posted by sweep View Post
    =INDIRECT("["&A6&".xlsx]Ark1!$B$2")

    This will only work if the destination workbook is open. To obtain values from closed workbooks, please do a quick search of the forum, it's a topic of frequent discussion.
    It worked excellent.
    Thank you, this was a big help!
    Merry Xmas!
    Last edited by Taste2Bad; 12-21-2010 at 12:44 PM.

+ 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