The Do While Loop continues a block of code, while the specified condition are continues to be met and evaluated to True, and stops when the condition turns False. The condition can be tested either at the start or at the end of the Loop.
Syntax
Do While (condition)
[statement 1]
[Exit Do]
[statement n]
Loop
How it works
Example of do while loop
Sub do_while_ex()
Do While i < 10
Debug.Print "The
value of i is : " & i
i = i + 1
Loop
End Sub
|
Result
The value of i is : 1
The value of i is : 2
The value of i is : 3
The value of i is : 4
The value of i is : 5
The value of i is : 6
The value of i is : 7
The value of i is : 8
The value of i is : 9
|

0 Comments