group name for form controls

  • Thread starter Thread starter Edwin Merced
  • Start date Start date
E

Edwin Merced

How can I access the group name property for the option button control
provided on the forms toolbar? As well as the other porperties of the form
control toolbox?
 
Unlike VB, in Excel VBA the option group box isn't - its
a frame, and doesn't have any properties that are set
when option buttons get set.
shame.
One workaoround is to use each option's click event to
save a number into the frame's TAG property - its not
used by anything else usually.
Then in your process, just read th etag value to get the
option.

Patrick Molloy
Microsft Excel MVP
 
This worked ok if the optionbutton (from the forms toolbar) was in a groupbox:

Option Explicit
Sub testme()
Dim optBTN As OptionButton
Set optBTN = ActiveSheet.OptionButtons("Option Button 1")
MsgBox optBTN.GroupBox.Name
End Sub

And you can find lots of properties for these old style things in the Object
browser (F2 in the VBE.)

Right click in the object brower and select show hidden members.
 
Back
Top