Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a userform with a bunch of checkboxes. I would like to identify the name of the checkbox that was clicked. Is there an equivalent statement to the one that allows me to get the name of the shape that was clicked? I think this works for the shapes: msgbox activesheet.shapes(application.caller).name I've tried: msgbox userform1.controls(application.caller).name Thanks you. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would think you'd use the _click event for that checkbox.
But this kind of thing worked ok for me: Option Explicit Private Sub CommandButton1_Click() MsgBox Me.ActiveControl.Name End Sub Private Sub UserForm_Initialize() Me.CommandButton1.TakeFocusOnClick = False End Sub This actually just shows the name of the control that has focus. borg wrote: Hi, I have a userform with a bunch of checkboxes. I would like to identify the name of the checkbox that was clicked. Is there an equivalent statement to the one that allows me to get the name of the shape that was clicked? I think this works for the shapes: msgbox activesheet.shapes(application.caller).name I've tried: msgbox userform1.controls(application.caller).name Thanks you. -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you for the quick response. It was exactly what I needed. Thanks again.
"Dave Peterson" wrote: I would think you'd use the _click event for that checkbox. But this kind of thing worked ok for me: Option Explicit Private Sub CommandButton1_Click() MsgBox Me.ActiveControl.Name End Sub Private Sub UserForm_Initialize() Me.CommandButton1.TakeFocusOnClick = False End Sub This actually just shows the name of the control that has focus. borg wrote: Hi, I have a userform with a bunch of checkboxes. I would like to identify the name of the checkbox that was clicked. Is there an equivalent statement to the one that allows me to get the name of the shape that was clicked? I think this works for the shapes: msgbox activesheet.shapes(application.caller).name I've tried: msgbox userform1.controls(application.caller).name Thanks you. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to make a checkbox on a chart invisible when it is clicked? | Charts and Charting in Excel | |||
Determine when checkbox is clicked | Excel Discussion (Misc queries) | |||
CheckBox in userform | Excel Programming | |||
CheckBox on UserForm | Excel Programming | |||
Userform and checkbox.... | Excel Programming |