Loop Until

Using logic combined from the Do Until and Loop While loops, the Loop Until loop uses a reverse logic condition at the end of its looping structure.

Dim x As Integer Dim y As Integer x = 5

MsgBox "How many times will this execute?"

Using an increment statement, this loop's statements execute four times. More specifically, the loop iterates until y becomes 6, which meets the loop's exit condition of true.

0 0

Post a comment