Require an Option Button Selection in a Word VBA UserForm
Question details
Require a user to select a classification level in a Word VBA UserForm before continuing.

- Product
- Microsoft Word VBA UserForm
- Device & OS
- not provided
- Scenario
- A UserForm validates text boxes and also needs to check a group of classification option buttons.
- Observed behavior
- The form should display a message and stop validation when no classification option is selected.
Open the document in Word and press Alt+F11 to locate the UserForm and its continue or submit button. Check the names of the classification option buttons in the Properties window.
Validate the classification option buttons before continuing
Use this check in the button's Click event to prevent the form from continuing until a classification is selected.
Option buttons in a group normally have True or False values. Test all buttons in the classification group because unselected buttons remain False even when another button is selected.
In the VBA editor, open the UserForm and select each classification OptionButton. Use a shared Frame or GroupName to keep the classification choices together, separate from other option button groups.
Double-click the form's continue or submit button to open its Click event. Locate the point after any text box checks and before the code that processes or closes the form.
Insert this code inside the Click event, replacing the three example names with your classification OptionButton names and adding any other buttons in the group: If Not (Me.optPublic.Value Or Me.optInternal.Value Or Me.optConfidential.Value) Then MsgBox "Please select a classification level.", vbExclamation Me.optPublic.SetFocus Exit Sub End If
Run the UserForm from the VBA editor. Click the continue button with no classification selected and confirm that the message appears; then select a classification and click the button again.
Edit Word documents with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with Word documents. Its format compatibility makes it easy to move everyday documents between Office applications. Word VBA UserForm behavior and macro compatibility may differ, so test any macro-dependent workflow separately.

Frequently Asked Questions
Why can't I check just one option button?
A single option button is False whenever another choice is selected. Check every button in the classification group with Or to determine whether at least one is True.
How do I stop the form from continuing when nothing is selected?
In the continue or submit button's Click event, show a MsgBox when all classification buttons are False, then use Exit Sub before the remaining processing code.
Can I use a ComboBox instead of option buttons?
Yes. In the button's Click event, check whether Me.ComboBox1.ListIndex = -1. If it is, display a message, call Me.ComboBox1.SetFocus, and use Exit Sub.
How do I keep classification buttons separate from other choices?
In the UserForm designer, place the classification OptionButtons in their own Frame or assign them a shared GroupName that is different from other groups.




