ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get sheet name in formula (https://www.excelbanter.com/excel-programming/434273-get-sheet-name-formula.html)

XP

Get sheet name in formula
 
Is there a formula that will return the current sheet name?

like: =Cell("Sheetname")

Thanks in advance!

Gary''s Student

Get sheet name in formula
 
=MID(CELL("filename"),FIND("]",CELL("filename"))+1,999)


In VBA, just:
MsgBox(ActiveSheet.Name)
--
Gary''s Student - gsnu200905


"xp" wrote:

Is there a formula that will return the current sheet name?

like: =Cell("Sheetname")

Thanks in advance!


Dave Peterson

Get sheet name in formula
 
Just to add to Gary's Student's response.

This formula:
=MID(CELL("filename"),FIND("]",CELL("filename"))+1,999)

will give you the name of the activesheet when excel recaluates--not necessarily
the name of the sheet containing the formula.

If you want the name of the sheet that contains the formula, then include a
cell's address in that formula (both spots). I like to use the cell address
that holds the formula:

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

ps. Both these formulas will only work if the workbook has been saved at least
once.

Gary''s Student wrote:

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

In VBA, just:
MsgBox(ActiveSheet.Name)
--
Gary''s Student - gsnu200905

"xp" wrote:

Is there a formula that will return the current sheet name?

like: =Cell("Sheetname")

Thanks in advance!


--

Dave Peterson


All times are GMT +1. The time now is 01:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com