How to get an ActiveButton name?

A

Arie Sukendro

Hi,
I'm looking for a code to get the activebutton name.
(When I click a button, the macro will pop up a message box showing the
button's name)
Can somebody help?

Thanks,
Arie
 
D

Dave Peterson

Is the button from the Forms toolbar?

msgbox application.caller

And if you're looking to do more things with that button:

dim myBTN as button
set myBTN = activesheet.buttons(application.caller)
msgbox mybtn.topleftcell.address 'and more stuff
 
Top