Option Buttons, Check Boxes and Frames

    

613-749-4695 (Peter)
[email protected]

Home Page

Tips and Ideas on Excel
Table of Contents on Excel

Tips and Ideas on Macros
Table of Contents on VBA

Quick Links

 

VBA Chapter 24F of 24: Option Buttons, Check Boxes and Frames

In the toolbox the option button  has this icon   VBA for Excel Option buttons icon, the check box has this one VBA for Excel check box icon and, the frame this one VBA for
Excel frame icon.

You don't 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 don't 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.

Properties

- WordWrap to be able to write more that one line in the caption,
- ControlTipText which generates a small comment box when the user moves the mouse over the control. You can use this property to give explanations and instructions about the option  button or the check box.
- Enabled and Visible are properties that you can change programmatically to disable or render invisible an option button or a check box following a previous selection in another control of the userform.

Frames

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 don't 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.

 

Next Chapter: Programming Multi Page in VBA for Excel

VBA Table of Contents
or use the quick links below

 

Discover Even More in 50 Excel spreadsheets

 

    

613-749-4695 (Peter)
[email protected]

Home Page

Tips and Ideas on Excel
Table of Contents on Excel

Tips and Ideas on Macros
Table of Contents on VBA

Quick Links

Option Buttons, Check Boxes and Frames