Forum Discussion
Jes Dideriksen
Jun 23, 2018Copper Contributor
Capture sheet name
When using the referencing or lookup functions, I frequently need to "capture" the name of a sheet. The function "Sheet" returns only the number of the sheet, even though a description says it retur...
- Jun 23, 2018
That's only VBA or parse result of the
=CELL("filename",<cell>)
SergeiBaklan
Jun 23, 2018MVP
Hi Jes,
Description doesn't say what SHEET() returns sheet name, it always returns the number of the sheet. You may use sheet name as parameter for the function, e.g. =SHEET("Sheet1") returns 1 and =SHEET("Sheet2") returns 2.
If you'd like your formula works with one sheet or another you may manually put sheet name in any cell, let say A1, at combine it with your formula using INDIRECT().
- Jes DideriksenJun 23, 2018Copper Contributor
Hi Sergei
Of course, you're right. there is nothing wrong with the example.
Anyone else that know of a function that reveals the sheet name?
- SergeiBaklanJun 23, 2018MVP
That's only VBA or parse result of the
=CELL("filename",<cell>)
- Jes DideriksenJun 23, 2018Copper Contributor
Thanks. I'll try that.