Grouping OptionButtons post-creation

  • Thread starter Thread starter Ed
  • Start date Start date
E

Ed

Anyone have any suggestions for how to group option
buttons after I've created/coded them? For example, I
need to group six new option buttons so that when any one
of them is selected, neither of my two other
optionbuttons (in a different group) are deselected?
 
Hi Ed,

Are these OptionButtons on a worksheet? If so, you could do something like
this:

Sub GroupOpts()
Dim n As Integer

For n = 1 To 5
With Sheet1.OLEObjects("OptionButton" _
& CStr(n)).Object
If n <= 3 Then
.GroupName = "grp1"
Else
.GroupName = "grp2"
End If
End With
Next n
End Sub

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 
Ed,

Are they ActiveX Toolbox control?

If, so, get the Control Toolbox toolbar up, and go to design mode (the blue
triangle icon to the left). Then select the optionbutton. Click the
properties icon, the hand pointing to a document next the design icon, and
there is a GroupName property that you can change.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top