By using expertatexcel.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

expertatexcel.com

 


Exit Do

This statement is used to prematurely exit a Do - Loop

Do
   x = x + 1
   debug.print x
   if x > 5 then Exit Do


Loop

In the above code snippet, x will eventually be set to 5 and the Exit Do will get out of the loop.

This statement can be used to prevent an infinite loop