PDA

View Full Version : Case with boolean



ksilenio
03-01-2020, 11:14 AM
Hi to every one .I have 3 option buttons (radio) and i want to take the .values which is true or false with a select case statement .How can i do it ?
Regards
Kostas

Bob Phillips
03-01-2020, 12:48 PM
Something like this?


Sub GetValue()

Select Case Application.Caller

Case "Option Button 1"

If ActiveSheet.OptionButtons("Option Button 1").Value Then

Debug.Print "Option button #1 clicked"
Else

Debug.Print "Option button #1 unclicked"
End If

Case "Option Button 2"

If ActiveSheet.OptionButtons("Option Button 2").Value Then

Debug.Print "Option button #2 clicked"
Else

Debug.Print "Option button #2 unclicked"

Case "Option Button 21"

If ActiveSheet.OptionButtons("Option Button 2").Value Then

Debug.Print "Option button #2 clicked"
Else

Debug.Print "Option button #2 unclicked"

End Select
End Sub

ksilenio
03-06-2020, 12:51 PM
Thank you very much for your answer