Need help with a case statement

My problem is that I need a case statement which changes a string based on what check boxes are checked. However, if one of the check boxes aren’t checked, it always changes to B, no matter which one is unchecked. Is there a way to make it related to a specific check box?

 Dim CommandString As String Select Case chk1.Checked And chk2.Checked And chk3.Checked Case True And True And True CommandString = "A" Case True And True And False CommandString = "B" Case True And False And True CommandString = "C" Case False And True And True CommandString = "D" Case True And False And False CommandString = "E" Case False And True And False CommandString = "F" Case False And False And True CommandString = "G" Case False And False And False CommandString = "H" Case Else MsgBox("Error.") CommandString = "" End Select 

submitted by /u/RECAPTCHArobit
[link] [comments]

Leave a Reply