ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Filename without dir & sheet name (https://www.excelbanter.com/new-users-excel/153010-filename-without-dir-sheet-name.html)

Alchemist

Filename without dir & sheet name
 
Tried =cell("filename",ref) but could not find how to remove the entire
directory and the worksheet name.

I only require the .xls filename without the sheet name.
ie. "c:\..\Template.xls[worksheet]" becomes "Template" only.

Excel help no help and searched here but nothing appeared similar.

Ron de Bruin

Filename without dir & sheet name
 
See
http://www.xldynamic.com/source/xld.xlFAQ0002.html

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Alchemist" wrote in message ...
Tried =cell("filename",ref) but could not find how to remove the entire
directory and the worksheet name.

I only require the .xls filename without the sheet name.
ie. "c:\..\Template.xls[worksheet]" becomes "Template" only.

Excel help no help and searched here but nothing appeared similar.


Smitty

Filename without dir & sheet name
 
Here's one way:

=MID(CELL("FILENAME",A1),FIND("[",CELL("FILENAME",A1))+1,FIND("]",CELL("FILENAME",A1))-FIND("[",CELL("FILENAME",A1))-5)

HTH,

Smitty

"Ron de Bruin" wrote:

See
http://www.xldynamic.com/source/xld.xlFAQ0002.html

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Alchemist" wrote in message ...
Tried =cell("filename",ref) but could not find how to remove the entire
directory and the worksheet name.

I only require the .xls filename without the sheet name.
ie. "c:\..\Template.xls[worksheet]" becomes "Template" only.

Excel help no help and searched here but nothing appeared similar.




All times are GMT +1. The time now is 02:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com