In the code for a command button, I want to show different message boxes based on the option button that is selected. I can not get this code to work. Option button 1 & 2 are a group and Option Button 3 & 4 are a different group.
With the code below no matter what is selected, I get MESSAGE 3.
If OptionButton1.Select Then
If OptionButton3.Select Then
MsgBox ("MESSAGE 1")
Else
MsgBox ("MESSAGE 2")
End If
Else
MsgBox ("MESSAGE 3")
End If
With the code below no matter what is selected, I get MESSAGE 3.
If OptionButton1.Select Then
If OptionButton3.Select Then
MsgBox ("MESSAGE 1")
Else
MsgBox ("MESSAGE 2")
End If
Else
MsgBox ("MESSAGE 3")
End If