QP School

Full Version: Do While loop in VBA
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Description:

The Do While loop repeats a block of code as long as a condition is true.

Example:

Sub ExampleDoWhileLoop()
    Dim i As Integer
    i = 1

    Do While i <= 5
        MsgBox "Iteration: " & i
        i = i + 1
    Loop
End Sub