I am creating a six question questionnaire with yes no answers. If yes is selected for any of the questions, additional questions appear further down the page. I was attempting to use option buttons, but could not group them into 6 separate groups of 2. I had used checkboxes to accomplish the goal in a clumsy fashion and ran into a bit of a problem. In this example checkbox1 is yes, checkbox2 is no. When checkbox one is selected, it changes the value for Checkbox2 if it is checked. This, in turn, executes the code for checkbox2. Is there a way to change the value of checkbox2 without executing the checkbox2 Click() subroutine OR is there a better use of option button code that is available?
Private Sub CheckBox1_Click()
If CheckBox2.Value = True Then CheckBox2.Value = False
If CheckBox1.Value = True And Range("SOD").EntireRow.Hidden = True Then Range("SOD").EntireRow.Hidden = False
If CheckBox1.Value = False And Range("SOD").EntireRow.Hidden = False Then Range("SOD").EntireRow.Hidden = True
--------------------------------------------------------
Private Sub CheckBox2_Click()
If CheckBox1.Value = True Then CheckBox1.Value = False
If Range("SOD").EntireRow.Hidden = False Then Range("SOD").EntireRow.Hidden = True
Range("Check1").Value = ((CheckBox1.Value = True) * 1) + ((CheckBox2.Value = True) * 2)
Private Sub CheckBox1_Click()
If CheckBox2.Value = True Then CheckBox2.Value = False
If CheckBox1.Value = True And Range("SOD").EntireRow.Hidden = True Then Range("SOD").EntireRow.Hidden = False
If CheckBox1.Value = False And Range("SOD").EntireRow.Hidden = False Then Range("SOD").EntireRow.Hidden = True
--------------------------------------------------------
Private Sub CheckBox2_Click()
If CheckBox1.Value = True Then CheckBox1.Value = False
If Range("SOD").EntireRow.Hidden = False Then Range("SOD").EntireRow.Hidden = True
Range("Check1").Value = ((CheckBox1.Value = True) * 1) + ((CheckBox2.Value = True) * 2)