Global Methods and Properties
The following methods and properties of the Application object are global and therefore can be used without the Application prefix.
This list can be obtained from the top list of classes in the Object Browser.
The Caller property of the Application object returns a reference to the object that called (or executed a macro procedure).
This property applies to controls on the Forms toolbar and drawing objects that have macros attached.
It is also particularly useful in determining the cell that called a user defined function.
Public Function WorksheetName() As String
Application.Volatile = True
WorksheetName = Application.Caller.Parent.Name
You cannot use "ActiveSheet.Name" in case the calculation is invoked when a different worksheet is selected.
© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext