|condition||Numeric or string expression that is true or false. If condition is Null, condition is treated as false.|
|statements||One or more statements that are repeated while or until condition is true.|
The Exit Do can only be used within a Do...Loop control structure to provide an alternate way to exit a Do...Loop. Any number of Exit Do statements may be placed anywhere in the Do...Loop. Often used with the evaluation of some condition (for example If...Then). Exit Do transfers control to the statement immediately following the Loop.
When used within nested Do...Loop statements, Exit Do transfers control to the loop that is nested one level above the loop where it occurs.
Do Until DefResp = vbNo
DefResp = MsgBox(MyNum & "Do you want another number?", vbYesNo)
Dim Check, Counter
Check = true: Counter = 0 'Initialize variables
Do 'Outer loop
Do While Counter < 20 'Inner loop
Counter = Counter + 1 'Increment Counter variable
If Counter = 10 Then
Check = false
Exit Do 'Exit inner loop
Loop Until Check = false 'Exit outer loop immediately