VBA 二つの整数の大きさを比較する
Sub 2整数の比較()
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As String
a = InputBox("整数を入力してください")
b = InputBox("整数を入力してください")
c = a + b
Select Case c
Case Is = 0
d = "0である"
Case Is < 0
d = "0未満である"
Case Is > 0
d = "0より大きい"
End Select
If a = b Then
d = "値が等しい"
End If
Call MsgBox(d)
End Sub