Function to return the current Worksheet name?

  • Thread starter Thread starter Steve
  • Start date Start date
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
 
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.
 
Hi Anne, thanks for the fast response. Your solution took me 30 seconds to
implement & 30 minutes to understand! :)

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
 
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)
 
Thanks Bob, amazing how much easier things become when exact syntax is
available.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top