ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   referring to the button that triggered the macro (https://www.excelbanter.com/excel-programming/402555-referring-button-triggered-macro.html)

[email protected]

referring to the button that triggered the macro
 
Hello,
In one of my subs I need to capture the name of the button that
triggered it. Something like
right(thisbutton.name,3).
Could anyone tell me how to do this?
Thanks a lot.
Herman

Bob Phillips

referring to the button that triggered the macro
 
Right(Application.Caller,3)

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



wrote in message
...
Hello,
In one of my subs I need to capture the name of the button that
triggered it. Something like
right(thisbutton.name,3).
Could anyone tell me how to do this?
Thanks a lot.
Herman




Mike H

referring to the button that triggered the macro
 
Callername = Right(Parent.Parent.Caller, 3)
MsgBox Callername

" wrote:

Hello,
In one of my subs I need to capture the name of the button that
triggered it. Something like
right(thisbutton.name,3).
Could anyone tell me how to do this?
Thanks a lot.
Herman



All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com