If you have cell filename in A1, you could use
=MID(A1,FIND("[",A1)+1,FIND("]",A1)-FIND("[",A1)-1)
or all in one cell with
=MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-FIND("[",CELL("filename"))-1)
good luck
Ian & Joe,
Gyula Lorant has proposed to use a named formula to do the task as reply to Joe's first post. I think Joe misundurstood it. The proposal requires that
you activate Insert|Name|Define;
you enter a name e.g., Doc as suggested by Gyula in the Names in Workbook box;
you enter in the Refers To box the formula:
=GET.DOCUMENT(88)
then just click OK.
Now activate any cell in any worksheet within the workbook and type
=Doc
This will produce the name of the workbook or file as Joe wants and as Ian's formula will compute.
PS. The workbook must have a filename (that is, it must have been saved at least once) for both Gyula's and Ian's formulas to work.
Aladin
=========
That's real slick - I didn't see the earlier post (nt)
Re : "The workbook must have a filename (that is, it must have been saved at least once) for both Gyula's and Ian's formulas to work"
For my suggested method to work, it is not necessary to have saved the workbook first - it will work even on a new workbook that has not been saved.
It is necessary to re-enter the cell formula whenever the workbook is re-named (could be done automatically via a simple Worksheet_SelectionChange procedure).