View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default what's the function to return a sheetname in a cell in Excel?

It could be if you had a 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

=SheetName()

The workbook does not have be saved first.

But the native function Peo posted works a little faster and who would want
to know the sheetname in an unsaved file?


Gord Dibben MS Excel MVP

On Thu, 2 Oct 2008 15:14:03 -0700, judi
wrote:

I was hoping it was this, and it ain't.

=sheetname()

or

=sheet()