ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sheet name question (https://www.excelbanter.com/excel-discussion-misc-queries/60458-sheet-name-question.html)

Adam Kroger

Sheet name question
 
is there a function that returns the name of the sheet it is on?



Paul B

Sheet name question
 
Adam, here is one way,

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

file must be saved first


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Adam Kroger @hotmail.com" <adam_kroger<nospam wrote in message
. ..
is there a function that returns the name of the sheet it is on?





Bob Phillips

Sheet name question
 
See http://www.xldynamic.com/source/xld.xlFAQ0002.html

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Adam Kroger @hotmail.com" <adam_kroger<nospam wrote in message
. ..
is there a function that returns the name of the sheet it is on?





Gord Dibben

Sheet name question
 
Adam

UDF.............

Function SheetName(Optional ByVal rng As Range) As String
Application.Volatile
If rng Is Nothing Then Set rng = Application.Caller
SheetName = rng.Parent.Name
End Function

OR........

See Bob Phillips' site for more on sheet and filenames.

http://www.xldynamic.com/source/xld.xlFAQ0002.html


Gord Dibben Excel MVP

On Wed, 14 Dec 2005 18:02:48 -0600, "Adam Kroger"
wrote:

is there a function that returns the name of the sheet it is on?


Adam Kroger

Sheet name question
 
Thanks


"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Adam

UDF.............

Function SheetName(Optional ByVal rng As Range) As String
Application.Volatile
If rng Is Nothing Then Set rng = Application.Caller
SheetName = rng.Parent.Name
End Function

OR........

See Bob Phillips' site for more on sheet and filenames.

http://www.xldynamic.com/source/xld.xlFAQ0002.html


Gord Dibben Excel MVP

On Wed, 14 Dec 2005 18:02:48 -0600, "Adam Kroger"
wrote:

is there a function that returns the name of the sheet it is on?





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

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