MartinS
Active Member
- Joined
- Jun 17, 2003
- Messages
- 460
- Office Version
-
- 365
- Platform
-
- Windows
I have written an Excel application that, amonst others, has some radio button controls. When populating the cntrols, I want to be able to run the click event for the control whose value is True. I have three radio buttons in a group, so only one can be set at any one tiome, and I am able to set this from an associated worksheet cell, but cannot remember if it's possible to run that event once you know it's name.
For example, I have found the control on the for that's value is True,
Can anyone help?
Thanks
Martin
For example, I have found the control on the for that's value is True,
Code:
'\* Define loop criteria...
For Each CTL In Me.Controls
'\* Set userform control association...
With CTL
'\* If control is an otion button...
If TypeName(CTL) = "OptionButton" Then
'\* If value in range equals control caption...
If Range(.Tag) = .Caption Then
'\* set value...
.Value = True
'\* generate click event name...
strROUTINE = .Name & "_Click"
'\* run click event...
[B]Call strROUTINE[/B]
End If
End If
End With
Next CTL
Thanks
Martin