Reading some answers in stackoverflow I saw a while
wend
loop. I'm used to the do while
loop
, so I was wondering what would be the difference between this two loops.
I did some testing (code below) and both seem to give me the same results.
Sub test_loop_1()
Dim i As Integer
i = 1
Do While i < 10
Cells(i, 1) = i
i = i + 1
Loop
End Sub
Sub test_loop_2()
Dim i As Integer
i = 1
While i < 10
Cells(i, 1) = i
i = i + 1
Wend
End Sub
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…