Function to return the current Worksheet name?

S

Steve

Is there a function that returns the current Worksheet name? I am creating
multiple Worksheets by Copying and Pasting the same "template" sheet and
would like as much of the worksheet specific text as possible to be
generated automatically.

Thanks, Steve
 
B

Barb Reinhardt

I've seen some VB code that does this, but can't seem to find it right now.
Try doing a Google search for it.
 
S

Steve

Hi Anne, thanks for the fast response. Your solution took me 30 seconds to
implement & 30 minutes to understand! :)

Steve
 
S

Steve

Thanks Barb, I had tried doing from within a VB macro but couldn't figure
out how to call the macro by invoking a function. I know I can invoke the
macro from a form but I don't want to start putting buttons or other form
elements on the worksheet.

Steve
 
B

Bob Phillips

Maybe something like this

Function ThisSheet() As String
ThisSheet = Application.Caller.Parent.Name
End Function

called from a worksheet with =ThisSheet()

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
S

Steve

Thanks Bob, amazing how much easier things become when exact syntax is
available.

Steve
 
Top