ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Linking to Tab Name (https://www.excelbanter.com/excel-discussion-misc-queries/23875-linking-tab-name.html)

Jeff B

Linking to Tab Name
 
How do I link a cell to the name of the worksheet tab?

Peo Sjoblom

Do you mean that you want the sheet name in a cell?
Workbook has to be saved,

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

you can put that formula in any cell, the cell function needs a reference
and A1 can be replaced with any cell reference

If you mean that you want to change the sheet name depending on what's in a
cell,
then you would need VBA (macro), if so post back


Regards,

Peo Sjoblom

"Jeff B" wrote:

How do I link a cell to the name of the worksheet tab?


Peo Sjoblom

It's easier to understand if you extract the cell part

=CELL("filename",A1)

will return path filename and sheet name

then mid "extracts" the sheet name which is at the end and the last
character before the sheet name is "]"

--
Regards,

Peo Sjoblom


"Jeff B" wrote in message
...
That works perfect. I don't understand the formula, but it gives the
result
I wanted.

Thank you.

Jeff


"Peo Sjoblom" wrote:

Do you mean that you want the sheet name in a cell?
Workbook has to be saved,

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

you can put that formula in any cell, the cell function needs a reference
and A1 can be replaced with any cell reference

If you mean that you want to change the sheet name depending on what's in
a
cell,
then you would need VBA (macro), if so post back


Regards,

Peo Sjoblom

"Jeff B" wrote:

How do I link a cell to the name of the worksheet tab?




All times are GMT +1. The time now is 04:35 PM.

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