View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Charlotte E Charlotte E is offline
external usenet poster
 
Posts: 59
Default Current Control Object ?

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,