optionbuttons should work dynamically

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
In module 1
Code:
Sub Assess_primary_risk_button_Click()
    Assess_primary_risk.Show
End Sub

In the Userform module
Code:
Private Sub CommandButton1_Click()
    Unload Me
End Sub

Private Sub Probability1_Click()
    Sheet1.Range("a1") = "True"
    Sheet1.Range("a2") = "False"
End Sub

Private Sub Probability2_Click()
    Sheet1.Range("a1") = "False"
    Sheet1.Range("a2") = "True"
End Sub

Private Sub UserForm_Initialize()
    Me.Probability1 = Sheet1.Range("a1")
    Me.Probability2 = Sheet1.Range("a2")
End Sub
 
Upvote 0
Another option
Code:
Option Explicit
Private Sub CommandButton1_Click()
   Unload Me
End Sub

Private Sub Probability1_Change()
   Sheet1.Range("A1").Value = Me.Probability1.Value
   Sheet1.Range("A2").Value = Not Me.Probability1.Value
End Sub

Private Sub UserForm_Initialize()
   Me.Probability1 = Sheet1.Range("A1")
   Me.Probability2 = Sheet1.Range("A2")
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,392
Members
449,081
Latest member
JAMES KECULAH

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