Retrieving current file name

Penfold

New Member
Joined
Mar 4, 2002
Messages
43
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
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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! :lol:

Cheers,

Penfold
 
Upvote 0
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)
 
Upvote 0
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?
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,223,382
Messages
6,171,767
Members
452,422
Latest member
rlynchbro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top