Mike said:
Can someone please refer me to an example on how
to use WHILE and LOOP in Excel's VBA?
In VBA Help, type "while wend statement" and "do loop statement" without
quotes, and you will get lots of information. A few simple examples.....
x = 1
While x <= y
[...some statements...]
x = x + 1
Wend
x = 1
Do While x <= y
[...some statements...]
x = x + 1
Loop
x = 1
Do Until x > y
[...some statements...]
x = x + 1
Loop
x = 1
Do
[...some statements...]
x = x + 1
Loop While x <= y
x = 1
Do
[...some statements...]
Loop Until x > y
The first 3 are equivalent to:
For x = 1 to y
[...some statements...]
Next