file name


Posted by ken on September 08, 2000 3:30 AM

non VBA way to get short file name from
long file name. Such as everything after the last slash
c:\My Documents\Private\next day\weekend projects.xls
into
weekend projects.xls

Posted by Ken on September 11, 0100 2:38 AM


That works just fine thank you

Posted by Celia on September 08, 0100 7:45 AM


Ken
If the file is the active workbook, here's one way.

Define a name (call it let's say WB) and type the following in the Refers To box :-
=Get.Document(88)

In any cell enter =WB

Celia



Posted by Celia on September 08, 0100 5:29 PM


If the full path name is not the same file as the active workbook, the following formula from John Walkenbach returns the file name from the full path name in cell A1 :-

=MID(A1,FIND("*",SUBSTITUTE(A1,"\","*",LEN(A1)-LEN(SUBSTITUTE(A1,"\",))))+1,LEN(A1))

Celia