Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Excel 2000 Picking up sheet name

  Asked By: Aditi    Date: Jan 24    Category: MS Office    Views: 1178
  

I have a number of sheets in a workbook.
For printing purposes I'm trying to pick up the name of the worksheet
in A1.

The formula I'm using is... in A1...
=MID(CELL("filename"),SEARCH("]",CELL("filename"))+1,LEN(CELL("filenam
e"))-SEARCH("]",CELL("filename"))+1)

I have a sheet named groceries and one named School.

Now comes the tricky bit.

I put that in A1 in worksheet Groceries... The cell says "Groceries".
Then I put that in A1 in worksheet School... The cell says "School".

Now I go back to worksheet Groceries.

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Garritt Bakker     Answered On: Jan 24

I use the sheet  name in a worksheet cell by adapting a function I found in one
of the internet groups.

Public Function SheetName() As String

' returns sheetname without specifying range
' could use either parent or worksheet in second line

Application.Volatile True
SheetName = Application.Caller.Parent.Name

End Function

You then just use =SheetName() in the cell where you want the sheetname to
appear.

 
Answer #2    Answered By: Cameron Smith     Answered On: Jan 24

Here is a user function to return the sheet  name:

Function SheetName()
SheetName = Application.Caller.Worksheet.Name
End Function

 
Didn't find what you were looking for? Find more on Excel 2000 Picking up sheet name Or get search suggestion and latest updates.




Tagged: