|  

» 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


Rate This Tip
12 34 5
Rating: 3.82     Views: 93280
Nice but...
I notice that if you have multiple sheets and you enter this formula on them, then all sheets have the same value as the last time you ran the formula...
Very much Interesting
Ganesh Dabholkar-INDIA Mumbai
I really appreciate, by your Excel tips.
From past 3 months I am trying for the same.

Once again Thanks for the same
RE: Nice but...
If you add a cell reference to the first CELL function like this:
=MID(CELL("filename",A1),FIND("]",CELL("filename"))+1,255) it will reference the current sheet instead of the sheet you were in the last time you ran the formula.
Wonderful !
venkat

suggestions on Formating cells are most welcome. Also tell us more formulaes, esp: on VLOOKUP.
Also note if you only have one sheet...
Chief~Plasma
If you only have one sheet then the finds for [ and ] will fail and you will get #value!.

Regards,
-cp
Click here to post comment
For Registered Users
Name
Comment Title
Comments