C
Charlotte E
When working with UserForms I normally assign the current control object
(CCO) to an object variable for ease of use, i.e.:
_________________________________
Private Sub OptionButton1_Click()
Dim CCO As Object
Set CCO = OptionButton1
If CCO.Value = False Then
CCO.ForeColor = 5
End If
End Sub
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Now I'm wondering if it is possible to set this object variable without
actually know the name of the control???
Maybe something like:
_________________________________
Dim CCO As Object
Set CCO = ThisControl.Name
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Hope I've made my explaning clear enough - or to put it short: Is there a
way of knowing what control the current control macro is for?
TIA,
(CCO) to an object variable for ease of use, i.e.:
_________________________________
Private Sub OptionButton1_Click()
Dim CCO As Object
Set CCO = OptionButton1
If CCO.Value = False Then
CCO.ForeColor = 5
End If
End Sub
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Now I'm wondering if it is possible to set this object variable without
actually know the name of the control???
Maybe something like:
_________________________________
Dim CCO As Object
Set CCO = ThisControl.Name
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Hope I've made my explaning clear enough - or to put it short: Is there a
way of knowing what control the current control macro is for?
TIA,