ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Identifying Button Clicked (https://www.excelbanter.com/excel-programming/304868-re-identifying-button-clicked.html)

Chip Pearson

Identifying Button Clicked
 
If these are buttons from the Forms toolbar, you can use
Application.Caller to return the name of the button that was
clicked. E.g.,

MsgBox "Button Clicked: " & Application.Caller



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Mister T" <Mister wrote in message
...
I have on a spreadsheet several buttons that trigger the same

macro. Let's say one of the buttons is in row 1, another in row
3, another in row 5, etc. If the row 1 button is clicked, I want
the macro to act on row 1; if the row 3 button is clicked, I want
the macro to act on row 3; etc. Therefore, I need the macro to
"know" which one of the buttons called it. Can that be done, and
how? Thanks.




All times are GMT +1. The time now is 11:14 AM.

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