Select Case ຄືການຄວບຄຸມ ຂອງເງືອນໄຂ ຄືກັນກັບ if else then ແຕ່ ມັນຈະໃຊ້ງ່າຍກວ່າ ຊຶ່ງມີ syntax ຂອງ Select Case ດັ່ງລຸ່ມນີ້
Select Case expression Case value1 Block of one or more VB statements Case value2 Block of one or more VB Statements Case Else Block of one or more VB Statements End Select
ຕົວຢ່າງ:
Dim grade As String Private Sub Compute_Click( ) grade=txtgrade.Text Select Case grade Case "A" result.Caption="High Distinction" Case "A-" result.Caption="Distinction" Case "B" result.Caption="Credit" Case "C" result.Caption="Pass" Case Else result.Caption="Fail" End Select End Sub