let a sub recognise the name of the button that has been clicked.

B

Brotherwarren

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.
 
J

Jim Rech

Application.Caller

should do it.

--
Jim
| 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.
|
 
B

Brotherwarren

That's the kind of advice I like! Nice one, it worked a treat! Thanks
a million Jim.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top