Copied from Bob Phillips' site........note: leave the "filename" as is.
Do
not substitute your file name.
File path, file and worksheet name:
=CELL("filename",A1)
File path only:
=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1),1)-1)
File name only:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1),1)+1,FIND("]",CELL("filename",A1),1)-FIND("[",CELL("filename",A1),1)-1)
The sheet name:
=MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)
Restrictions
This technique only works for workbooks that have been saved, at least
once.
http://www.xldynamic.com/source/xld.xlFAQ0002.html
Bob's site is temporarily down.
Gord Dibben MS Excel MVP
Is there any way for me to access the name of the current Worksheet tab,
to
put it into a cell? I need a cell whose name changes based on the name
entered on the Worksheet tab.
Thanks,
Colin