Case文で分岐
実行プログラム
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
Sub Sample2_2_1() Dim intScore As Integer intScore = Cells(1, 2).Value Select Case intScore Case Is > 100 MsgBox "error" Case Is = 100 MsgBox "S判定" Case Is >= 90 MsgBox "A判定" Case Is >= 80 MsgBox "B判定" Case Is >= 70 MsgBox "C判定" Case Else MsgBox "D判定" End Select End Sub |
実行結果