Thread: Worksheet name
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Martin Fishlock Martin Fishlock is offline
external usenet poster
 
Posts: 3
Default Worksheet name

Another way to do it is to call a macro as follows:

Option Explicit

Function SheetName(Optional CellOnWorksheet As Range) As String
Application.Volatile ' update on changes
On Error Resume Next
If CellOnWorksheet Is Nothing Then
Set CellOnWorksheet = Application.Caller
End If
SheetName = "Error!"
SheetName = CellOnWorksheet.Parent.Name
End Function


HTHs

Martin Fishlock.


"Music Lover" wrote in message
...
try the following to see if it helps.

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

Inportance: Your worksheet file should be named, if not , you will get
error in it)

Regards

A HKSAR Friend

"Elaine"
.gbl...
Hi guys

is there a way to use the worksheet name as the contents of a cell?
As in, I would like my A1 cell to contain the name of the current Sheet,
is that possible, I've tried searching but no luck.

Many thanks!!

Elaine