VBA基本 Lesson6

問題と実行結果 Lesson6

VBA Basic Lesson6

問題1

Sub Lesson6_1()

    Dim i As Long

    For i = 2 To 21

        Cells(i, "E") = Cells(i, "B") + Cells(i, "C") + Cells(i, "D")

    Next i

End Sub

問題2

Sub Lesson6_2()

    Dim i As Long

    For i = 2 To 21

        If (Cells(i, "B") + Cells(i, "C") + Cells(i, "D")) / 3 >= 70 And Cells(i, "C") >= 40 Then

            Cells(i, "F") = "合格"

        End If

    Next i

End Sub

問題3

Sub Lesson6_3()

    Dim i As Long

    For i = 2 To 21

        If Cells(i, "E") / 3 >= 70 And Cells(i, "B") > 40 And Cells(i, "C") > 40 And Cells(i, "D") > 40 Then

            Cells(i, "F") = "合格"

        End If

    Next i

End Sub

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

Excel

前の記事

VBA基本 Lesson5
VBA

次の記事

VBA基本 Lesson7