Userform Optionbuttons

bahllr

Board Regular
Joined
May 7, 2009
Messages
62
I have two option buttons on a userform. One says yes and one says no. There are two command buttons (back and next).

If the user selects yes and then clicks the next button, I want it to go to userform2. However, if the user selects NO and then clicks the Next button, I want it to got to userform3.

Is there a way to code this? I don't know how to code if a optionbutton is 'active'?

Any ideas?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
You use the property value to determine if it is active.
Try this code
the optionbuttons are named optYes and optNo



Code:
Private Sub cmdNext_Click()
If optNo.Value = True Then
    UserForm3.Show
ElseIf optYes.Value = True Then
    UserForm2.Show
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top