Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Function that returns name og curred sheet

Does anyone know hot to make a function that returns the name of the curred
sheet as a string

I would like to have something like

="You are on sheet" & sheetname()

Greetings Hans


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Function that returns name og curred sheet

Hi
To get the current worksheet name try:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)

--
Regards
Frank Kabel
Frankfurt, Germany

hans wrote:
Does anyone know hot to make a function that returns the name of the
curred sheet as a string

I would like to have something like

="You are on sheet" & sheetname()

Greetings Hans

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Function that returns name og curred sheet

Note that this requires that the workbook has been saved at least once
(rather than being a new workbook with a default name like Book1 as an
example).

--
Regards,
Tom Ogilvy

"Frank Kabel" wrote in message
...
Hi
To get the current worksheet name try:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)

--
Regards
Frank Kabel
Frankfurt, Germany

hans wrote:
Does anyone know hot to make a function that returns the name of the
curred sheet as a string

I would like to have something like

="You are on sheet" & sheetname()

Greetings Hans



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Function that returns name og curred sheet

Hans

Programming method.

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

Gord Dibben Excel MVP

On Mon, 16 Feb 2004 17:04:00 +0100, "hans" wrote:

Does anyone know hot to make a function that returns the name of the curred
sheet as a string

I would like to have something like

="You are on sheet" & sheetname()

Greetings Hans


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Function that returns name og curred sheet

Thanks for the help.

Greeetings Hans


"Gord Dibben" <gorddibbATshawDOTca schreef in bericht
...
Hans

Programming method.

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

Gord Dibben Excel MVP

On Mon, 16 Feb 2004 17:04:00 +0100, "hans"

wrote:

Does anyone know hot to make a function that returns the name of the

curred
sheet as a string

I would like to have something like

="You are on sheet" & sheetname()

Greetings Hans




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF function returns function statement rather than result ckrogers Excel Worksheet Functions 3 April 16th 09 09:21 PM
GETPIVOTDATA returns zero when copied to another sheet Frank Hayes[_3_] Excel Worksheet Functions 2 January 24th 09 10:16 PM
Help formula that returns a text string from another sheet Stuart k Excel Worksheet Functions 1 April 7th 08 01:53 PM
Autosum returns 0 value on data sheet EricB Excel Worksheet Functions 13 January 9th 07 11:53 AM
INT Function Returns 1 bhavesh Excel Worksheet Functions 3 December 29th 06 02:48 PM


All times are GMT +1. The time now is 08:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"