Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
let a sub recognise the name of the button that has been clicked.
Here's the problem,
I have a map of my classroom as a picture on a worksheet. I have the pupils in the class represented by shapes, with a macro assigned that loads a userform containg a textbox. Each button has its name property set to so it matches the pupil's own name. I need to click each button, have the userform load and then set the textbox's value to the name of the pupil that was clicked. My question is: Is it possible to have a sub recognise the Name of the button that was clicked to run the sub? Cheers in advance. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
let a sub recognise the name of the button that has been clicked.
Application.Caller
should do it. -- Jim "Brotherwarren" wrote in message oups.com... | Here's the problem, | I have a map of my classroom as a picture on a worksheet. I have the | pupils in the class represented by shapes, with a macro assigned that | loads a userform containg a textbox. | Each button has its name property set to so it matches the pupil's own | name. | | I need to click each button, have the userform load and then set the | textbox's value to the name of the pupil that was clicked. | | My question is: | Is it possible to have a sub recognise the Name of the button that was | clicked to run the sub? | | Cheers in advance. | |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
let a sub recognise the name of the button that has been clicked.
That's the kind of advice I like! Nice one, it worked a treat! Thanks
a million Jim. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I insert radio button to sum a cell when clicked | Excel Worksheet Functions | |||
Command Button Assignment | Excel Discussion (Misc queries) | |||
Runing two macros triggered by a button | Excel Discussion (Misc queries) | |||
Command Button VBA code | Excel Discussion (Misc queries) | |||
Macro to simply bring up the Find dialogue box?? | Excel Discussion (Misc queries) |