Sub Fornext02() Dim i As Integer Range("I3:J5").Value = 0 For i = 3 To 17 'B3~17へ繰り返す If Month(Cells(i, "B").Value) = 1 And Cells(i, "C").Value <> "" Then Range("I3").Value = Range("I3").Value + Cells(i, "C").Value '1月分のセルI3にお預り金額合計を表示 ElseIf Month(Cells(i, "B").Value) = 1 And Cells(i, "D").Value <> "" Then Range("J3").Value = Range("J3").Value + Cells(i, "D").Value '1月分のセルJ3にお支払金額合計を表示 ElseIf Month(Cells(i, "B").Value) = 2 And Cells(i, "C").Value <> "" Then Range("I4").Value = Range("I4").Value + Cells(i, "C").Value '2月分のセルI4にお預り金額合計を表示 ElseIf Month(Cells(i, "B").Value) = 2 And Cells(i, "D").Value <> "" Then Range("J4").Value = Range("J4").Value + Cells(i, "D").Value '2月分のセルJ4にお支払金額合計を表示 ElseIf Month(Cells(i, "B").Value) = 3 And Cells(i, "C").Value <> "" Then Range("I5").Value = Range("I5").Value + Cells(i, "C").Value '3月分のセルI5にお預り金額合計を表示 ElseIf Month(Cells(i, "B").Value) = 3 And Cells(i, "D").Value <> "" Then Range("J5").Value = Range("J5").Value + Cells(i, "D").Value '3月分のセルJ5にお支払金額合計を表示 End If Next End Sub