Get The Workbook And Sheet Name With A Formula
These formulas require that the workbook is saved
Get the file name of this workbook:
=CELL("filename",A1)
Result: C:[MyWorkbook.xlsx]Sheet1
Get the file name of this workbook without the file extension:
=MID(CELL("filename",A1),SEARCH("[",CELL("filename",A1))+1,SEARCH(".",CELL("filename",A1))-1-SEARCH("[",CELL("filename",A1)))
Result: MyWorkbook
Get the active sheet name:
=RIGHT(CELL("Filename",A1),LEN(CELL("Filename",A1))-FIND("]",CELL("Filename",A1)))
Result: Sheet1
Reference another sheet name:
="'"&MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)&"'!"
Result: ‘Sheet1!