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