Retrieving current file name
Retrieving current file name
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 8 of 8

Thread: Retrieving current file name

  1. #1
    New Member
    Join Date
    Mar 2002
    Location
    Australia
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I'm not sure whether I'm having a mental blank or not. Is there a simple formula that lists the current excel file you're in? I know that you can use INFO("directory") to get the path name, but what about the file name?

    Thanks.

    Penfold

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Penfold

    I have a couple of UDF's here that may suit you:
    http://www.ozgrid.com/VBA/WorkbookPath.htm



  3. #3
    New Member
    Join Date
    Mar 2002
    Location
    Australia
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Dave, I was hoping that Excel would already have a built in way of doing it, but it appears not. I'll have to use the User Defined Function instead.

    Nice website btw. I just discovered I've been using dynamic ranges without even knowing that I've been doing it. Ah OFFSET - hell to learn but mighty powerful once you understand it!

    Cheers,

    Penfold

  4. #4
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Penfold

    There is a nested formula that does this it's:

    =MID(CELL("fileName"),FIND("[",CELL("fileName"))+1,FIND("]",CELL("fileName"))-FIND("[",CELL("fileName"))-1)

  5. #5
    New Member
    Join Date
    Mar 2002
    Location
    Australia
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    OK, now have the path & file name working ok via the User Defined Function, however the **** thing is not updating even when pressing recalc (F9). How do you get it to automatically recalculate the function when opening the file?

  6. #6
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Put:

    Application.Volatile

    as the first line



  7. #7

    Join Date
    Feb 2002
    Posts
    39
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Here's another way.

    Define a Name called WB and type in the RefersTo box :-
    =GET.DOCUMENT(88)

    Typing =WB in any cell will return the workbook name.

  8. #8
    New Member
    Join Date
    Mar 2002
    Location
    Australia
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Ah, thanks Dave.

    Penfold

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com