VBA基本 Lesson3

問題と実行結果 Lesson3

VBA Basic Lesson3

問題1

Sub Lesson3_1()

    Dim i As Long

    For i = 2 To 21

        If Format(Cells(i, 1), "m") = "2" Then

            Cells(i, 4).Value = Cells(i, 2).Value * Cells(i, 3).Value

        End If

    Next i

End Sub

問題2

Sub Lesson3_2()

    Dim i As Long

    For i = 2 To 21

        If Format(Cells(i, 1), "aaa") = "金" Then

            Cells(i, 4) = Cells(i, 2) * Cells(i, 3)

        End If

    Next i

End Sub

※使用している内容は、「Office TANAKA」VBA Basic セミナー受講資料から許可を得て引用しております。
田中先生ありがとうございます。