XL97: Macro Examples Using OptionButton Controls on a UserForm (159705)
The information in this article applies to:
- Microsoft Excel 97 for Windows
This article was previously published under Q159705 SUMMARY
There are two ways to group option buttons on a UserForm. To group the
controls, do either of the following:
- Place the option buttons inside a Frame control.
-or-
- Use the GroupName property to create a group.
Both of these methods create a group for the specified option buttons,
which makes each of the option buttons (within a group) mutually exclusive.
This means that when you click any option button in the group, all other
option buttons in the group are set to false.
Neither method is better than the other one. The method you use depends on
how you want to implement the project and whether you want to use a Frame
control for each group on the UserForm or use macro code.
This article contains macro examples that use both methods. This article
also contains an example that illustrates a third method that does not
require grouping of option buttons.
REFERENCES
For more information about grouping option buttons, click the Index tab in
Microsoft Excel Visual Basic Help, type the following text
and then double-click the selected text to go to the "GroupName Property"
topic.
| Modification Type: | Minor | Last Reviewed: | 10/10/2006 |
|---|
| Keywords: | kbdtacode kbProgramming KB159705 |
|---|
|