VBA Help

  • Thread starter Thread starter Rw
  • Start date Start date
R

Rw

In a user form I have 6 radio buttons, 3 inside one frame, and 3
indentical inside another frame. I want to be able to make it so that
the radio button selected in one frame cannot be the same in the other
frame? Hopefully this can be solved!
Thanks

** Posted via: http://www.ozgrid.com
Excel Templates, Training, Add-ins & Software! Free Support at
http://www.ozgrid.com/forum/ **
 
If I understand you correctly:

Assume Options Buttons1-3 in Frame1, OptionButtons4-6 in Frame2:

Private Sub OptionButton1_Click()
OptionButton2.Enabled = Not OptionButton5.Value
OptionButton3.Enabled = Not OptionButton6.Value
OptionButton4.Enabled = False
OptionButton5.Enabled = True
OptionButton6.Enabled = True
End Sub
Private Sub OptionButton2_Click()
OptionButton1.Enabled = Not OptionButton4.Value
OptionButton3.Enabled = Not OptionButton6.Value
OptionButton4.Enabled = True
OptionButton5.Enabled = False
OptionButton6.Enabled = True
End Sub
Private Sub OptionButton3_Click()
OptionButton1.Enabled = Not OptionButton4.Value
OptionButton2.Enabled = Not OptionButton5.Value
OptionButton4.Enabled = True
OptionButton5.Enabled = True
OptionButton6.Enabled = False
End Sub

Private Sub OptionButton4_Click()
OptionButton1.Enabled = False
OptionButton2.Enabled = True
OptionButton3.Enabled = True
OptionButton5.Enabled = Not OptionButton2.Value
OptionButton6.Enabled = Not OptionButton3.Value
End Sub
Private Sub OptionButton5_Click()
OptionButton1.Enabled = True
OptionButton2.Enabled = False
OptionButton3.Enabled = True
OptionButton4.Enabled = Not OptionButton1.Value
OptionButton6.Enabled = Not OptionButton3.Value
End Sub
Private Sub OptionButton6_Click()
OptionButton1.Enabled = True
OptionButton2.Enabled = True
OptionButton3.Enabled = False
OptionButton4.Enabled = Not OptionButton1.Value
OptionButton5.Enabled = Not OptionButton2.Value
End Sub
 
Back
Top