Grouping buttons

Copper Contributor
Hi, I have a form containing 25 command buttons divided into 5 groups. I want them to behave like a radio button, that is, when I click a button in group "a" it will be red and all other 4 button of the group remain blue (for example). Till now I used a function to set all buttons first:
Function groupA()
End function

Then in every button click event I change its color:
Sub B1_click()
End sub

Is there a better way?
3 Replies


What you want is a set of Option Groups, five in all. Each of these Option Groups will contain 5 of your buttons.


Thanks, that's what I need. Can I make the quickstyle of the selected button (toggle button) change when it is selected (clicked)?
I'm not sure how much control you have over the appearance of radio buttons. Perhaps try it out and see if the default behavior is sufficient.