This statement executes a series of statements as long as a specified condition is True.
While condition
[statements]
Wend
If condition is True, all statements in statements are executed until the Wend statement is encountered. Control then returns to the While statement and condition is again checked. If condition is still True, the process is repeated. If it is not True, execution resumes with the statement following the Wend statement.
While...Wend loops can be nested to any level. Each Wend matches the most recent While.
The Do...Loop statement provides a more structured and flexible way to perform looping.