ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Display tab name in cell (https://www.excelbanter.com/excel-programming/424546-display-tab-name-cell.html)

Jock

Display tab name in cell
 
How can I display the ActiveSheet.name in cell C5 for instance?

TIA
--
Traa Dy Liooar

Jock

Eduardo

Display tab name in cell
 
Hi,
copy the formula as follow in the cell where you want to display the name

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

If this was helpful please say yes. Thank you

"Jock" wrote:

How can I display the ActiveSheet.name in cell C5 for instance?

TIA
--
Traa Dy Liooar

Jock


Jock

Display tab name in cell
 
Thanks Eduardo
--
Traa Dy Liooar

Jock


"Eduardo" wrote:

Hi,
copy the formula as follow in the cell where you want to display the name

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

If this was helpful please say yes. Thank you

"Jock" wrote:

How can I display the ActiveSheet.name in cell C5 for instance?

TIA
--
Traa Dy Liooar

Jock


Rick Rothstein

Display tab name in cell
 
I think you can safely leave the optional cell reference argument off of the
function calls as the file name would be the same no matter what cell is
referenced...

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

--
Rick (MVP - Excel)


"Eduardo" wrote in message
...
Hi,
copy the formula as follow in the cell where you want to display the name

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

If this was helpful please say yes. Thank you

"Jock" wrote:

How can I display the ActiveSheet.name in cell C5 for instance?

TIA
--
Traa Dy Liooar

Jock



Rick Rothstein

Display tab name in cell
 
Eduardo has given you a worksheet formula solution to your question;
however, since you posted your question in the "programming" newsgroup, I
thought you might be looking for a UDF (User Defined Function). The UDF for
this question is quite simple...

Function TabName()
TabName = ActiveSheet.Name
End Function

To install the UDF, press Alt+F11 to go into the VB editor and click
Insert/Module from its menu bar, then copy/paste the above code into the
code window that opened up there. To use the UDF, just place this formula...

=TabName()

into any cell that you want the TabName to appear in.

--
Rick (MVP - Excel)


"Jock" wrote in message
...
How can I display the ActiveSheet.name in cell C5 for instance?

TIA
--
Traa Dy Liooar

Jock



Eduardo

Display tab name in cell
 
Your welcome,

"Jock" wrote:

Thanks Eduardo
--
Traa Dy Liooar

Jock


"Eduardo" wrote:

Hi,
copy the formula as follow in the cell where you want to display the name

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

If this was helpful please say yes. Thank you

"Jock" wrote:

How can I display the ActiveSheet.name in cell C5 for instance?

TIA
--
Traa Dy Liooar

Jock


Dave Peterson

Display tab name in cell
 
This isn't true.

To test:

Create a workbook with a couple of worksheets (and save it at least once)
then use this formula (without the range reference).
=MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)

And show multiple windows (window|new window in xl2003 menus)

And recalculate (hit F9) and watch what each formula evaluates to.


Rick Rothstein wrote:

I think you can safely leave the optional cell reference argument off of the
function calls as the file name would be the same no matter what cell is
referenced...

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

--
Rick (MVP - Excel)

"Eduardo" wrote in message
...
Hi,
copy the formula as follow in the cell where you want to display the name

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

If this was helpful please say yes. Thank you

"Jock" wrote:

How can I display the ActiveSheet.name in cell C5 for instance?

TIA
--
Traa Dy Liooar

Jock


--

Dave Peterson

Rick Rothstein

Display tab name in cell
 
Nothing odd happens when I do that... the tab name appears the same in all
the windows for that formula. What are you suggesting should have happened?
My XL2003 is at Service Pack 2 if that might matter.

--
Rick (MVP - Excel)


"Dave Peterson" wrote in message
...
This isn't true.

To test:

Create a workbook with a couple of worksheets (and save it at least once)
then use this formula (without the range reference).
=MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)

And show multiple windows (window|new window in xl2003 menus)

And recalculate (hit F9) and watch what each formula evaluates to.


Rick Rothstein wrote:

I think you can safely leave the optional cell reference argument off of
the
function calls as the file name would be the same no matter what cell is
referenced...

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

--
Rick (MVP - Excel)

"Eduardo" wrote in message
...
Hi,
copy the formula as follow in the cell where you want to display the
name

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

If this was helpful please say yes. Thank you

"Jock" wrote:

How can I display the ActiveSheet.name in cell C5 for instance?

TIA
--
Traa Dy Liooar

Jock


--

Dave Peterson



egun

Display tab name in cell
 
Rick,

I also thought he might like the UDF solution, but didn't offer it because
he seemed to like the formula route well enough. However, when I created the
UDF, it didn't always update when I manually CHANGED the sheet name. Then I
added Application.Volatile vbTrue, and that seemed to make it work. Is that
your experience also?

Thanks,

Eric

"Rick Rothstein" wrote:

Eduardo has given you a worksheet formula solution to your question;
however, since you posted your question in the "programming" newsgroup, I
thought you might be looking for a UDF (User Defined Function). The UDF for
this question is quite simple...

Function TabName()
TabName = ActiveSheet.Name
End Function

To install the UDF, press Alt+F11 to go into the VB editor and click
Insert/Module from its menu bar, then copy/paste the above code into the
code window that opened up there. To use the UDF, just place this formula...

=TabName()

into any cell that you want the TabName to appear in.

--
Rick (MVP - Excel)




Rick Rothstein

Display tab name in cell
 
Good catch! I completely forgot about the possibility the sheet name might
get changed. As you indicated, this is how the code should have be
constructed...

Function TabName()
Application.Volatile vbTrue
TabName = ActiveSheet.Name
End Function

Thanks for catching that omission for me.

--
Rick (MVP - Excel)


"egun" wrote in message
...
Rick,

I also thought he might like the UDF solution, but didn't offer it because
he seemed to like the formula route well enough. However, when I created
the
UDF, it didn't always update when I manually CHANGED the sheet name. Then
I
added Application.Volatile vbTrue, and that seemed to make it work. Is
that
your experience also?

Thanks,

Eric

"Rick Rothstein" wrote:

Eduardo has given you a worksheet formula solution to your question;
however, since you posted your question in the "programming" newsgroup, I
thought you might be looking for a UDF (User Defined Function). The UDF
for
this question is quite simple...

Function TabName()
TabName = ActiveSheet.Name
End Function

To install the UDF, press Alt+F11 to go into the VB editor and click
Insert/Module from its menu bar, then copy/paste the above code into the
code window that opened up there. To use the UDF, just place this
formula...

=TabName()

into any cell that you want the TabName to appear in.

--
Rick (MVP - Excel)





Dave Peterson

Display tab name in cell
 
Without the reference to the cell, the formula will use the activesheet (in the
activeworkbook).

Are you sure that you had multiple different windows in view?

Rick Rothstein wrote:

Nothing odd happens when I do that... the tab name appears the same in all
the windows for that formula. What are you suggesting should have happened?
My XL2003 is at Service Pack 2 if that might matter.

--
Rick (MVP - Excel)

"Dave Peterson" wrote in message
...
This isn't true.

To test:

Create a workbook with a couple of worksheets (and save it at least once)
then use this formula (without the range reference).
=MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)

And show multiple windows (window|new window in xl2003 menus)

And recalculate (hit F9) and watch what each formula evaluates to.


Rick Rothstein wrote:

I think you can safely leave the optional cell reference argument off of
the
function calls as the file name would be the same no matter what cell is
referenced...

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

--
Rick (MVP - Excel)

"Eduardo" wrote in message
...
Hi,
copy the formula as follow in the cell where you want to display the
name

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

If this was helpful please say yes. Thank you

"Jock" wrote:

How can I display the ActiveSheet.name in cell C5 for instance?

TIA
--
Traa Dy Liooar

Jock


--

Dave Peterson


--

Dave Peterson

Rick Rothstein

Display tab name in cell
 
Okay, I see what you mean. I really do hate the CELL function as it seems to
be an odd one as functions go.

--
Rick (MVP - Excel)


"Dave Peterson" wrote in message
...
Without the reference to the cell, the formula will use the activesheet
(in the
activeworkbook).

Are you sure that you had multiple different windows in view?

Rick Rothstein wrote:

Nothing odd happens when I do that... the tab name appears the same in
all
the windows for that formula. What are you suggesting should have
happened?
My XL2003 is at Service Pack 2 if that might matter.

--
Rick (MVP - Excel)

"Dave Peterson" wrote in message
...
This isn't true.

To test:

Create a workbook with a couple of worksheets (and save it at least
once)
then use this formula (without the range reference).
=MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)

And show multiple windows (window|new window in xl2003 menus)

And recalculate (hit F9) and watch what each formula evaluates to.


Rick Rothstein wrote:

I think you can safely leave the optional cell reference argument off
of
the
function calls as the file name would be the same no matter what cell
is
referenced...

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

--
Rick (MVP - Excel)

"Eduardo" wrote in message
...
Hi,
copy the formula as follow in the cell where you want to display the
name

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

If this was helpful please say yes. Thank you

"Jock" wrote:

How can I display the ActiveSheet.name in cell C5 for instance?

TIA
--
Traa Dy Liooar

Jock

--

Dave Peterson


--

Dave Peterson



Dave Peterson

Display tab name in cell
 
There are legal (from Windows standpoint) that make the =cell() formulas even
uglier.

Rick Rothstein wrote:

Okay, I see what you mean. I really do hate the CELL function as it seems to
be an odd one as functions go.

--
Rick (MVP - Excel)

"Dave Peterson" wrote in message
...
Without the reference to the cell, the formula will use the activesheet
(in the
activeworkbook).

Are you sure that you had multiple different windows in view?

Rick Rothstein wrote:

Nothing odd happens when I do that... the tab name appears the same in
all
the windows for that formula. What are you suggesting should have
happened?
My XL2003 is at Service Pack 2 if that might matter.

--
Rick (MVP - Excel)

"Dave Peterson" wrote in message
...
This isn't true.

To test:

Create a workbook with a couple of worksheets (and save it at least
once)
then use this formula (without the range reference).
=MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)

And show multiple windows (window|new window in xl2003 menus)

And recalculate (hit F9) and watch what each formula evaluates to.


Rick Rothstein wrote:

I think you can safely leave the optional cell reference argument off
of
the
function calls as the file name would be the same no matter what cell
is
referenced...

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

--
Rick (MVP - Excel)

"Eduardo" wrote in message
...
Hi,
copy the formula as follow in the cell where you want to display the
name

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

If this was helpful please say yes. Thank you

"Jock" wrote:

How can I display the ActiveSheet.name in cell C5 for instance?

TIA
--
Traa Dy Liooar

Jock

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

Dave Peterson

Display tab name in cell
 
There are legal (from Windows standpoint) *file names* that make the =cell()
formulas even
uglier.

(I left out a couple of words.)

Dave Peterson wrote:

There are legal (from Windows standpoint) that make the =cell() formulas even
uglier.

Rick Rothstein wrote:

Okay, I see what you mean. I really do hate the CELL function as it seems to
be an odd one as functions go.

--
Rick (MVP - Excel)

"Dave Peterson" wrote in message
...
Without the reference to the cell, the formula will use the activesheet
(in the
activeworkbook).

Are you sure that you had multiple different windows in view?

Rick Rothstein wrote:

Nothing odd happens when I do that... the tab name appears the same in
all
the windows for that formula. What are you suggesting should have
happened?
My XL2003 is at Service Pack 2 if that might matter.

--
Rick (MVP - Excel)

"Dave Peterson" wrote in message
...
This isn't true.

To test:

Create a workbook with a couple of worksheets (and save it at least
once)
then use this formula (without the range reference).
=MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)

And show multiple windows (window|new window in xl2003 menus)

And recalculate (hit F9) and watch what each formula evaluates to.


Rick Rothstein wrote:

I think you can safely leave the optional cell reference argument off
of
the
function calls as the file name would be the same no matter what cell
is
referenced...

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

--
Rick (MVP - Excel)

"Eduardo" wrote in message
...
Hi,
copy the formula as follow in the cell where you want to display the
name

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

If this was helpful please say yes. Thank you

"Jock" wrote:

How can I display the ActiveSheet.name in cell C5 for instance?

TIA
--
Traa Dy Liooar

Jock

--

Dave Peterson

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 08:14 PM.

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