I've got a model with a code that should depend on the selection of one of two option buttons. When a user opens the model, the both option buttons are unselected. I need to make sure that the user selects one of them before the main code is run. So if nothing is selected, then it should display a message box saying something like "Please select an option" and stop the rest of the code from executing.
I guess it should be an IF statement using OptionButton.Value = False as a condition, but I cannot figure out how to do it. It should be something like
But it obviously does not work.
I guess it should be an IF statement using OptionButton.Value = False as a condition, but I cannot figure out how to do it. It should be something like
VBA Code:
Sub optionbuttonselect()
If ActiveSheet.OptionButtons("Option Button 2").Value = False Then
If ActiveSheet.OptionButtons("Option Button 4").Value = False Then
MsgBox "Check the options"
End If
End If
End Sub
But it obviously does not work.