Select Multiple Radio Buttons Independently

Donal28

Well-known Member
Joined
Apr 23, 2010
Messages
527
Hi All

I have a User form with 70 categories that each have radio button options of 0,1,2. I am finding that the form will only allow me to select 1 radio button at time where I need to select 70 different options of 0,1,2 individually. I have tried grouping the options for each set of 3 radio buttons and called the groups diffferent names but still find that it only allows me to select 1 radio button on the form.


any help on this would be very much appreciated

Regards

Donal
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
What do you mean you tried "grouping the options"? You should be able to put ea group in a frame (that's a lot of frames IMO) or better, use the GroupName property.
 
Upvote 0
Thanks for the reply. I read on some of the boards that grouping them works better for this kind of thing so basically I have selected the 3 radio buttons right-clicked and selected group and did this for the 70 different options. when I try putting them in individual frames the frame covers the radio buttons so they are not visible. I'm not familiar with the GroupName property, Is this a better option?
 
Upvote 0
when I try putting them in individual frames the frame covers the radio buttons so they are not visible.
You'd need to create the frame first, then create the buttons inside the frame.

But go with GTO's suggestion if you can.
 
Upvote 0
Thanks for the reply. I read on some of the boards that grouping them works better for this kind of thing so basically I have selected the 3 radio buttons right-clicked and selected group and did this for the 70 different options. when I try putting them in individual frames the frame covers the radio buttons so they are not visible. I'm not familiar with the GroupName property, Is this a better option?

At least IMO, yes. Nothing against a frame or two, but 70+ would seem crowded. The other neat thing w/GroupName is that the the controls can be spread out anyplace on the form.

AFAIK, the "group"ing you were referring to has to do with moving controls around during design, and probably changed z-order (thus the disappearing act)
 
Upvote 0
I've terid using the following code(below the error) to change the GroupName Property for each set of 3 radio buttions but still doesn't seem to work. getting the error

Runtime error 438 - Object doesn;t support this property or method

Private Sub OptionButton1_Click()
ActiveSheet.OptionButton1.GroupName = "One"

End Sub

Private Sub OptionButton2_Click()
ActiveSheet.OptionButton2.GroupName = "Two"
End Sub
 
Upvote 0
Hi All

I have a User form with 70 categories that each have radio button options...

Runtime error 438 - Object doesn;t support this property or method

Private Sub OptionButton1_Click()
ActiveSheet.OptionButton1.GroupName = "One"

End Sub

Private Sub OptionButton2_Click()
ActiveSheet.OptionButton2.GroupName = "Two"
End Sub

:eeek: Uhmmm... I thought these were on a userform?
 
Upvote 0
They are on a user form....I think whe I created the grouping that it also created a method called Private Sub OptionButton1_Click() though as I'm not too familiar with creating radio buttons I'm not so sure! Sorry I'm a bit new to this should i just get rid of the OptionButton1_Click() methods then and just use OptionButton1.GroupName = "One"?
 
Upvote 0
Change the group name property in design mode.
You can set it for multiple buttons by selecting them all.
PS Have you considered using comboxes or listboxes? Might be easier to work with and you can set the properties so they look line of like option buttons.
 
Upvote 0
Thanks for the reply Norie. I had considerreed dropdowns but this is the designed that has been preferred. I have now named all the 70 categoresi with different GroupNames and am now trying to put code behind a button to add the selected data to the spreadsheet. I have the below code but it seeems to be puttting the data in Cell L for some reaosn and it will only put the number 2 in the spreadsheet even when 1 or 0 is selected

Private Sub EnterDetails_Click()
ActiveWorkbook.Sheets("B1 Exam 29000").Activate
Range("K1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
If One = True Then
ActiveCell.Offset(0, 1).Value = "0"
ElseIf One = True Then
ActiveCell.Offset(0, 1).Value = "1"
Else
ActiveCell.Offset(0, 1).Value = "2"
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top