Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Brotherwarren
 
Posts: n/a
Default 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   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.
|


  #3   Report Post  
Posted to microsoft.public.excel.misc
Brotherwarren
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I insert radio button to sum a cell when clicked Joe D. Excel Worksheet Functions 1 March 6th 06 08:54 PM
Command Button Assignment Bill Martin Excel Discussion (Misc queries) 2 January 1st 06 02:50 AM
Runing two macros triggered by a button Dave Peterson Excel Discussion (Misc queries) 0 December 9th 05 12:43 AM
Command Button VBA code Dave Peterson Excel Discussion (Misc queries) 2 January 25th 05 11:28 PM
Macro to simply bring up the Find dialogue box?? marika1981 Excel Discussion (Misc queries) 14 January 14th 05 10:47 PM


All times are GMT +1. The time now is 04:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"