Consulting

Results 1 to 3 of 3

Thread: Case with boolean

  1. #1
    VBAX Regular
    Joined
    Aug 2019
    Posts
    54
    Location

    Case with boolean

    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

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,455
    Location
    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
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Aug 2019
    Posts
    54
    Location
    Thank you very much for your answer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •