Part | Description | ||
condition | Required. Numeric expression or string expression that evaluates to True or False. If condition is Null, condition is treated as False. | ||
statements | Optional. One or more statements executed while condition is True. |
Dim Counter
Counter = 0 ' Initialize variable.
While Counter < 20 ' Test value of Counter.
Counter = Counter + 1 ' Increment Counter.
Wend ' End While loop when Counter > 19.
Debug.Print Counter ' Prints 20 in Debug window.