How to get an ActiveButton name?

  • Thread starter Thread starter Arie Sukendro
  • Start date Start date
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
 
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
 

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