View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim Rech
 
Posts: n/a
Default 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.
|