![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: Australia
Posts: 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 |
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Penfold
I have a couple of UDF's here that may suit you: http://www.ozgrid.com/VBA/WorkbookPath.htm |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Location: Australia
Posts: 43
|
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 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
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 |
|
New Member
Join Date: Mar 2002
Location: Australia
Posts: 43
|
OK, now have the path & file name working ok via the User Defined Function, however the damn thing is not updating even when pressing recalc (F9). How do you get it to automatically recalculate the function when opening the file?
|
|
|
|
|
|
#6 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Put:
Application.Volatile as the first line |
|
|
|
|
|
#7 |
|
Join Date: Feb 2002
Posts: 39
|
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 |
|
New Member
Join Date: Mar 2002
Location: Australia
Posts: 43
|
Ah, thanks Dave.
Penfold |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|