Attribute VB_Name = "test4" Sub テスト() Dim x As Integer x = 10 * 5 Range("A1").Value = x Range("A2").Value = 30 / 8 Dim str As String str = "テスト" If str = "テスト" Then Range("A3").Value = "変数の値はテストです" Else Range("A3").Value = "変数の値はテストではありません" End If Dim y As Integer y = 18 If y > 10 And y < 20 Then Range("A4").Value = "変数の値は10から20の間の数値です" End If End Sub