Worksheet name in formula

J

Jeffrey

Is there a formula that will display the sheet name within the cell? I know this doesn't work like this, but something like
=[TAB

Any suggestions? Before you respond, I already know that I can write a function to return the value. I'm hoping for a <u>formula</u? that will return the value <u>without</u> having to write code.
 
F

Frank Kabel

Hi
try one of the following formulas (note: the workbook has to be save
before). Just use the formulas as they are shown (don't
replace 'filename' with anything else)

File path and file 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("]",CEL
L("filename",A1),1)-FIND("[",CELL("filename",A1),1)-1)

The sheet name
=RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-FIND("]",CELL("file
name",A1),1))


--
Regards
Frank Kabel
Frankfurt, Germany

Jeffrey said:
Is there a formula that will display the sheet name within the cell?
I know this doesn't work like this, but something like:
=[TAB]

Any suggestions? Before you respond, I already know that I can write
a function to return the value. I'm hoping for a <u>formula</u? that
will return the value <u>without</u> having to write code.
 
D

DDM

Jeffrey, pull up this page from Chip Pearson's Website and scroll way down
to Miscellaneous: http://www.cpearson.com/excel/excelF.htm#FileName.

--
DDM
"DDM's Microsoft Office Tips and Tricks"
Visit us at www.ddmcomputing.com


Jeffrey said:
Is there a formula that will display the sheet name within the cell? I
know this doesn't work like this, but something like:
=[TAB]

Any suggestions? Before you respond, I already know that I can write a
function to return the value. I'm hoping for a <u>formula</u? that will
return the value <u>without</u> having to write code.
 
Top