=MID(CELL("filename"), FIND("[", CELL("filename"))+1, FIND("]", CELL("filename"))- FIND("[", CELL("filename")) -1)
=REPLACE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1),1,FIND("[",CELL("filename",A1)),"")
=REPLACE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-6),1,FIND("[",CELL("filename",A1)),"")
If you have more that one workbook open, the above formula displays the name of the last workbook altered.Code:=MID(CELL("filename"), FIND("[", CELL("filename"))+1, FIND("]", CELL("filename"))- FIND("[", CELL("filename")) -1)
The below formula will display the workbook name that the formula exist in.
-or- without the ".xlsm"Code:=REPLACE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1),1,FIND("[",CELL("filename",A1)),"")
Code:=REPLACE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-6),1,FIND("[",CELL("filename",A1)),"")