Function to return the active sheet name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know of a way to write a customised VBA function that will return
the name of the sheet on which the function is being called? I can do this
very easily when that is the active sheet, using the activesheet.name
property, but how can this be done when that sheet is not active?
 
Will,

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

HTH,
Bernie
MS Excel MVP
 

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