指定した条件で処理を繰り返す
A列の2行目以下の数字を合計する。
While条件(条件が正しい間)
Sub test2()
Dim i As Long
Dim c As Long
i = 2
'空白ではない間処理を続ける
Do While Cells(i, 1) <> ""
c = c + Cells(i, 1)
i = i + 1
LoopMsgBox c
End Sub
Until条件(条件が正しくない間)
Sub test2()
Dim i As Long
Dim c As Long
i = 2
'空白ではない間処理を続ける
Do While Cells(i, 1) <> ""
c = c + Cells(i, 1)
i = i + 1
LoopMsgBox c
End Sub