VBA Lesson 31: Option Buttons, Check Boxes and Frames
This is an excerpt from Pierre Leclerc (www.excel-vba.com)
In the toolbox the option button has this icon , the check box has this one and, the frame this one .
You do not need to add a label to accompany the check box or the option button because they come with their own.
The check boxes and the option buttons are both used to offer the user a choice. The main difference between check boxes and option buttons is that if you have 5 of each on a form a user can check all 5 check boxes but can only select one of the option buttons.
If you want to create two sets of option buttons read below on frames and option buttons. If you do not want to use frames to create groups of option buttons you will need to use the "GroupName" property of the option buttons. All option buttons with the same GroupName work together.
- WordWrap to be able to write more that one line in the caption,
Frames are also a passive control. Frames are used to improve the layout of the userform. You can use them around a group of controls that have something in common.
Frames become more important to manage option buttons. If you have two sets of option buttons on a userform and you do not place them within a frame they all work together and you can choose only one. If you put each set within a frame you can choose one in each set.
When you move a frame all its controls move with it.
Go to the next lesson