Code to display Worksheet names

W

Webem0ch

Hi - I am looking for a formula/code that will display the worksheet
name within which it is placed.

For example: If I have a worksheet named "Apples" and in cell A1
within this worksheet I have code that somehow says; ='s worksheet name
- Cell A1 would then read as "Apples"

Is this possible?

Advance thanks,

Michael
 
J

Jason Morin

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))
+1,255)

Note: wb must be already saved to work.

HTH
Jason
Atlanta, GA
 
M

mzehr

Try any of the following
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("]",CELL("filename",A1),1)-FIND
("[",CELL("filename",A1),1)-1)
The sheet name =RIGHT(CELL("filename",A1),LEN(CELL
("filename",A1))-FIND("]",CELL("filename",A1),1))

HTH
 
A

Andy B

Hi

Try one of the following formulas (note: the workbook has to be saved before
it'll work)

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("]",CELL("fi
lename",A1),1)-FIND("[",CELL("filename",A1),1)-1)

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

Copy and paste the formulas as they are - on a single line.
 
W

Webem0ch

Thank you, Thank you, Thank you!

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))
+1,255)

Sincerely,

Michae
 
Top