Get Name of Macro Initiator
Assume you mean buttons from forms toolbar.
Sub Button_click()
Dim sName as String, btn as Button
sname = Application.Caller
set btn = Activesheet.Buttons(sname)
msgbox btn.Caption
End Sub
If you mean a picture that looks like a button, the approach would be
similar but you couldn't use the buttons collection
--
Regards,
Tom Ogilvy
"SpaceCamel" wrote:
I have many graphical buttons on a sheet with different names/properties but
all initiate the same macro. I need the macro to get the name/properties of
the initiating button.
Is there a "who started me" value I can get?
Thanks,
|