Ian Elliott wrote...
....
I would like to get the filename with a worksheet function, is this possible?
I tried help "filename" and "file" but nothing of relation. What is a good
way to search for these things on the help file?
First, online help. You could always try looking up the term filename
in the help index. Actually, there's no entry for 'filename', but you'd
see 'file name' in the 'Or choose keywords' section of the help dialog.
The first topic for 'file name' is the CELL worksheet functions (at
least in XL10 (XP/2002)).
That said, CELL("Filename",A1) only returns the pathname if the file
has been saved. If you had other worksheets, you could use some
trickery. If you wanted the filename in a cell in worksheet A and you
also had a worksheet B, try
=MID(CELL("Address",B!$A$1),FIND("[",CELL("Address",B!$A$1))+1,
FIND("]",CELL("Address",B!$A$1))-FIND("[",CELL("Address",B!$A$1))-1)
This CELL("Address",Range) returns the workbook and worksheet names
along with the cell address when Range is in a different worksheet from
the cell calling the CELL function in its formula, EVEN IF THE FILE
HASN'T BEEN SAVED.
So one has to wonder why CELL("Filename",Range) returns "" for unsaved
files.