I think that I understand now. The option buttons are in different groups.
Not sure if you need instructions to put the code into the VBA editor but I
will include it anyway.
If your option button names do not match the ones in the code then you will
have to edit the code and correct names.
On the worksheet where the option buttons exist, click on the Design Mode
button.
Right click on the first 'Yes' option button.
Select View Code.
Copy the following code and paste it in between the Private Sub and End Sub
which automatically appeared.
ActiveSheet.OptionButton3.Visible = False
ActiveSheet.OptionButton4.Visible = False
Alt/F11 will take you back to the worksheet.
Right click on your first 'No' button.(While still in Design Mode)
Select View Code.
Copy the following code and paste it in between the Private Sub and End Sub
which automatically appeared.
ActiveSheet.OptionButton3.Visible = True
ActiveSheet.OptionButton4.Visible = True
Close the VBA Editor (The cross in the red rectangle at the top right)
Alt/F11 to return to the worksheet.
Turn off Design Mode.
Now the code is supposed to make buttons 3 and 4 non visible when the first
Yes button is clicked and make them visible if the first No button is
clicked. However, it is dependent on the second set of buttons having
matching names to the ones in the macro. That is OptionButton3 and
OptionButton4. If not then you will need to edit the code to match.
To return to the VBA editor Alt/F11 toggles between the editor and the
worksheet. If the code you pasted in is not immediately visible, then in the
Project Explorer on the left, double click on the sheet name matching the one
with the buttons.
Just as an added extra, the following code can be used to set the caption on
the buttons:-
ActiveSheet.OptionButton3.Caption = "My Question one"
ActiveSheet.OptionButton4.Caption = "My Question two"
Alternative method to set the caption equal to cell values
ActiveSheet.OptionButton3.Caption = ActiveSheet.Range("A1")
ActiveSheet.OptionButton4.Caption = ActiveSheet.Range("B1")
Regards,
OssieMac