+ Reply to Thread
Results 1 to 7 of 7

Changing folder/file name in formula

  1. #1
    Registered User
    Join Date
    02-12-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    38

    Changing folder/file name in formula

    HI all.

    Is it possible to change the folder/file name in a formula.

    IE. in cell A1 for instance I have a client name - BOB. In cell A2 i would like a formula that opens file path C:\clients\bob\bob.xls and give the A1 refence in that file.

    However the A1 cell with BOB will change names to JOE, BILL, MATT etc. hence the formula needs to change folder/file names as well.

    Is this possible?

    Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Changing folder/file name in formula

    yes
    =HYPERLINK("C:\clients\"& A1 & "\"&A1&".xlsx")

    Also
    if you dont want the whole path listed and only the name
    =HYPERLINK("C:\clients\"& A1 & "\"&A1&".xlsx",A1)
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    02-12-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Changing folder/file name in formula

    Ok, seems to work. Thanks.
    What if I need it from a different tab/sheet name within that file. IE Sheet/tab names are Bob March, Bob April etc.

  4. #4
    Registered User
    Join Date
    02-12-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Changing folder/file name in formula

    Sorry to confuse you all further, but I think I might be off track here.

    In the end I need something like the following.

    cell A1 - client name
    cell A2 - =large(c:\clients\bob\bob.xlsx\totals tab!$d$5:$d$10,1)

    The client name in A1 will always change, therefore I need the client in the formula to change with it.
    The totals tab and cell references are the same location in every client file, so its only the client name that changes.

    Thanks again

  5. #5
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Changing folder/file name in formula

    are you linking the file itself or information from the file?

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Changing folder/file name in formula

    =LARGE(INDIRECT("["&A1&".xlsx]"&B1&"!$D$5:$d$10"),1)
    A1 = File name
    B1 = Sheet name

    if you try to put the path in it doesnt work...i dont know how to get around it

  7. #7
    Registered User
    Join Date
    02-12-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Changing folder/file name in formula

    Thanks for all your help in this Humdingaling.

    I've got this at the moment, but due to the limits of INDIRECT, only works if target file is open.

    =LARGE(INDIRECT("'c:\clients\"&$A$1&"\["&$A$1&" .xls]April'!$D$5:$D$10"),1)

    *EDIT*
    I will download INDIRECT.EXT shortly, and this should work fine.
    Last edited by Gallinski; 07-18-2013 at 12:50 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Changing File Names in Excel Folder
    By JPDutch in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 12-02-2011, 11:31 PM
  2. Changing Folder from the default folder
    By cg7131 in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 08-29-2011, 04:56 PM
  3. Finding folder name from a file path - formula
    By jamesryan in forum Excel General
    Replies: 2
    Last Post: 02-04-2009, 06:59 AM
  4. Replies: 6
    Last Post: 08-11-2006, 03:41 PM
  5. macro to move from file to file, folder to folder
    By davegb in forum Excel General
    Replies: 0
    Last Post: 01-21-2005, 04:06 PM

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