Function to return the active sheet name

W

Will

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?
 
B

Bernie Deitrick

Will,

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

HTH,
Bernie
MS Excel MVP
 
Top