ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Worksheet Name Variable? (https://www.excelbanter.com/excel-discussion-misc-queries/211037-worksheet-name-variable.html)

Mike McLellan

Worksheet Name Variable?
 
I'm using Excel 2003 SP3 under Windows XP and want to be able to pick up the
name of a worksheet from within the sheet in question to use in populating a
string of text. Is their a system variable or some other way that enables me
to do this?

Max

Worksheet Name Variable?
 
I like & use this method (inspired by a Harlan posting)

In a pre-saved book (book must have been saved beforehand)

Click Insert Name Define
Put under "Names in workbook:": WSN
Put in the "Refers to:" box:
=MID(CELL("Filename",INDIRECT("A1")),FIND("]",CELL("Filename",INDIRECT("A1")
))+1,32)
Click OK

The above defines WSN as a name we can use to refer to the sheetname in
formulas. It will auto-extract the sheetname implicitly.

Test it out. In any sheet in the book, in any cell: =WSN
will return that particular sheet's name
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:20,500 Files:363 Subscribers:64
xdemechanik
---
"Mike McLellan" wrote:
I'm using Excel 2003 SP3 under Windows XP and want to be able to pick up the
name of a worksheet from within the sheet in question to use in populating a
string of text. Is their a system variable or some other way that enables me
to do this?


Mike McLellan

Worksheet Name Variable?
 
Excellent - works a treat! Many thanks

"Max" wrote:

I like & use this method (inspired by a Harlan posting)

In a pre-saved book (book must have been saved beforehand)

Click Insert Name Define
Put under "Names in workbook:": WSN
Put in the "Refers to:" box:
=MID(CELL("Filename",INDIRECT("A1")),FIND("]",CELL("Filename",INDIRECT("A1")
))+1,32)
Click OK

The above defines WSN as a name we can use to refer to the sheetname in
formulas. It will auto-extract the sheetname implicitly.

Test it out. In any sheet in the book, in any cell: =WSN
will return that particular sheet's name
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:20,500 Files:363 Subscribers:64
xdemechanik
---
"Mike McLellan" wrote:
I'm using Excel 2003 SP3 under Windows XP and want to be able to pick up the
name of a worksheet from within the sheet in question to use in populating a
string of text. Is their a system variable or some other way that enables me
to do this?


Max

Worksheet Name Variable?
 
Welcome. Could you take a moment to rate the response by pressing the Yes
button in the earlier response (like the one below)? Thanks.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:20,500 Files:363 Subscribers:64
xdemechanik
---
"Mike McLellan" wrote:
Excellent - works a treat! Many thanks




All times are GMT +1. The time now is 03:37 PM.

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