N
NAHolmes
Is it possible to return the file name value to a cell without the '.xlsx'?
Thanks.
Thanks.
JLatham said:Try this:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-6)
Keep in mind that the "filename" used with CELL() does not return anything
until the workbook has been saved.
or if you definitely know that the filename ends with .xlsx (and not .xlsm
or other Excel 2007 file type identifier), then this would work:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND(".xlsx]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-1)
NAHolmes said:Is it possible to return the file name value to a cell without the '.xlsx'?
Thanks.
Jacob Skaria said:Try the below in a saved workbook.
=TRIM(LEFT(SUBSTITUTE(MID(CELL("filename",A1),
FIND("[",CELL("filename",A1))+1,255),".xl",REPT(" ",255)),255))
If this post helps click Yes
---------------
Jacob Skaria
NAHolmes said:Is it possible to return the file name value to a cell without the '.xlsx'?
Thanks.
NAHolmes said:This also worked, again - many thanks.
JLatham said:Try this:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-6)
Keep in mind that the "filename" used with CELL() does not return anything
until the workbook has been saved.
or if you definitely know that the filename ends with .xlsx (and not .xlsm
or other Excel 2007 file type identifier), then this would work:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND(".xlsx]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-1)
NAHolmes said:Is it possible to return the file name value to a cell without the '.xlsx'?
Thanks.