Use worksheet name

A

Andreas Håkansson

Hi

Is it possible to use the worksheet name in a fomula? I want it to be
retrieved automatically so I can do

=VLOOKUP(<<automatically get worksheet name>>;A1:A10;2)

and similar other operations. I do not want to manually enter the name since
I would like to be able to copy this formula to alot of
worksheets and I'm trying to reduce the time it takes to copy such formulas
around.
 
M

Martin

Would CELL("Address") help or do you just want the active sheet to be
returned? If the latter, there doesn't seem to be an Excel function so
here's a user defined function (just paste it into a new module of your
workbook):

Function thisSheet()
thisSheet = ActiveCell.Parent.Name
End Function
 
G

Gary''s Student

Use CELL():


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

will return only the worksheet name (a part of the full path name)
 
Top