Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identifying Button Clicked
Assume these are buttons from the forms toolbar
Sub Btn_click() Dim btn as Button set btn = Activesheet.Buttons(Application.Caller) rw = btn.topLeftCell.row End Sub Application.Caller returns the name (a string) of the button triggering the macro. -- Regards, Tom Ogilvy "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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro button gets bigger when clicked | Excel Discussion (Misc queries) | |||
let a sub recognise the name of the button that has been clicked. | Excel Discussion (Misc queries) | |||
Identifying Button Clicked | Excel Programming | |||
Pause macro, add form button to sheet, continue macro when button clicked! | Excel Programming | |||
Button event clicked problem | Excel Programming |