optionbuttons should work dynamically

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
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,223,888
Messages
6,175,213
Members
452,618
Latest member
Tam84

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