You are here LEARN EXCEL & VBA Excel Tips Excel General Cell Function Returns Sheet Name, Workbook Name and Path

Cell Function Returns Sheet Name, Workbook Name and Path

The Cell function returns information about the formatting, location, or contents of the upper-left cell in a reference.

To get the sheet name:
=MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)

To get the workbook name:
=MID(CELL("filename"),FIND("[",CELL("filename"))+1,(FIND("]",CELL("filename"))+1)-FIND("[",CELL("filename"))-2)

To get the path address & workbook name:
=CELL("filename")

To get the path address:
=MID(CELL("filename"),1,FIND("[",CELL("filename"))-1)
Screenshot // Cell Function Returns Sheet Name, Workbook Name and Path
Cell Function Returns Sheet Name, Workbook Name and Path