option buttons in user forms

VBAmalta89

Board Regular
Joined
Mar 25, 2011
Messages
116
I have two frames in a user form. Above each of these frames is an option button.

What I need is for these option buttons to control which frame is activated, i,e when the user form is launched both frames are inactive but once the user clicks on one of the option buttons the frame becomes active.

Can i do this or something similar in VBA?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Set the Enabled property of each frame in the option button's Click event:
Code:
Private Sub OptionButton1_Click()
    Me.Frame1.Enabled = True
    Me.Frame2.Enabled = False
End Sub
and similar for the other option button.
 
Upvote 0
ok that works..just one more question..

how can i make it that when the user form is launched both frames are disabled until the user selects an option button?
 
Upvote 0

Forum statistics

Threads
1,224,509
Messages
6,179,192
Members
452,893
Latest member
denay

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