MrExcel Publishing
Your One Stop for Excel Tips & Solutions

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
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

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 :-

In any cell enter =WB


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 :-