Making independent groups of option buttons
Asked Answered
I

5

15

I am looking to make sort of a little form with groups of checkboxes and option buttons which will later feed a vba code. I need to make group boxes with 3 option boxes in them but independent. As it is now i press one of the options bokes and it inchecks an option box in the other group. They are all connected and i don't want this. Any Ideas? Thanks

Incommunicable answered 19/7, 2013 at 17:25 Comment(4)
You need to group the related options in a frame control.Orndorff
a control frame? is this a group box?Incommunicable
A nice answer by user2140261. Refer THISHerder
The answer depends on what kind of a control you added...Form vs ActiveX. I assume you're talking about Form Controls, based on your answer (and I don't think the question would have come up if it was an ActiveX control).Timeous
T
9

You need to enclose each group of option buttons in a Group Box control. You can access this from the same menu you used to add the buttons.

See this link for more info: http://office.microsoft.com/en-us/excel-help/add-a-group-box-or-frame-control-to-a-worksheet-HP010236679.aspx.

Telephony answered 19/7, 2013 at 18:3 Comment(3)
this is what i did but it does not work. i have 2 group boxes which each have 3 option buttons on them. i click one otion button in box 1 then lick another option button in box2 and the other option in box1 unshades. every option button are connected even though i put them in group boxes.Incommunicable
I think this was a bug because i tries again and it worked this timeIncommunicable
I don't think this is a bug, just that you need to ensure that the option buttons are inserted entirely within their Frame.Handout
Y
16

A simple way to do is to set the GroupName property for the option buttons in the form. Set it to OB1 for first three option buttons and OB2 for the next three option buttons. Now they will work as two groups and you can check one each from eithr groups.

Yukyukaghir answered 5/1, 2015 at 10:16 Comment(1)
Form Controls don't have a GroupName property. ActiveX Controls do. The OP should have mentioned (or someone should have asked) what kind of control they were using.Timeous
T
9

You need to enclose each group of option buttons in a Group Box control. You can access this from the same menu you used to add the buttons.

See this link for more info: http://office.microsoft.com/en-us/excel-help/add-a-group-box-or-frame-control-to-a-worksheet-HP010236679.aspx.

Telephony answered 19/7, 2013 at 18:3 Comment(3)
this is what i did but it does not work. i have 2 group boxes which each have 3 option buttons on them. i click one otion button in box 1 then lick another option button in box2 and the other option in box1 unshades. every option button are connected even though i put them in group boxes.Incommunicable
I think this was a bug because i tries again and it worked this timeIncommunicable
I don't think this is a bug, just that you need to ensure that the option buttons are inserted entirely within their Frame.Handout
M
2

I agree with Nixz's response and would like to add more detail. Nixz posted: A simple way to do is to set the GroupName property for the option buttons in the form. Set it to OB1 for first three option buttons and OB2 for the next three option buttons. Now they will work as two groups and you can check one each from eithr groups.

To make this work for me, I edited the GroupName in Properties for each radio button selection. For one group, I edited the two selections' GroupName(s) and called them each Question2. For the second set, I edited the GroupName for each radio button choice, calling them both Question5. This told excel they were grouped, even though they were in a Group Box, eXcel was not recognizing them as in separate Group Boxes. Hope this helps!

Munshi answered 26/6, 2017 at 16:48 Comment(0)
V
1

As an alternative to previous answers, I will present a very special technique that I think most of you will just love, in case you are willing to take the effort on following my last Exact Instructions Challenge.

Since it seems now I caught your attention, let's do it.

Although you must still define at least two Group Boxes, I suggest that you:

  1. Add one base Option Button anywhere in worksheet outside of any group. You will use this Option Button for replication. You may delete it later, once you are finished

  2. Press ESC twice, to unselect control;

  3. Point the mouse cursor on base Option Button and press Right Click. This will select the control and open a small menu;

  4. Press ESC once. This will close the small menu, but it will keep target control selected;

  5. Now comes the tricky part:

    5.1 Press CTRL key;

    5.2 Press mouse LEFT CLICK button;

    5.3 While keeping both pressed, move you mouse to your target group inner area. This will show a replic of your base control;

    5.4 Release your mouse LEFT CLICK button. This will create a replic your Option Button inside your target group;

    5.5 You may now repeat steps 5.2 thru 5.4 to create any replics you need.

Once you're done, you may release your CTRL key and delete your base Option Button, selecting it using Right Click, pressing ESC key once and pressing DEL key.

For beginners, bear in mind that this neat replication feature (CTRL+LeftClick drag) is widely used on graphical editors.

Hope it helps others from preventing the ridiculous time I did mastering how to overcome this abnoxious UI behavior.

Vapor answered 25/3, 2020 at 19:31 Comment(1)
This worked great for me. I found I could use the same method to copy/paste a new set of buttons inside of a new group.Lycopodium
W
-1

You need to set up same group names in properties editor for each option button separately! when you copy and paste you option buttons the default group is "menu" even after grouping it from menu the default group is still same "menu" so that's why you see the strange behavior of groups.

Writeoff answered 11/5 at 16:23 Comment(1)
Please consider editing your answer to be more objective, stating only the facts of the answer and how it can help and reducing the unnecessary and distracting SHOUTING. For information on how to best use the site, please check out the How to Ask, How to Answer and tour links. For more detail, please check out the help center link and the Meta Stack Overflow meta site.Tiemroth

© 2022 - 2024 — McMap. All rights reserved.