While - Wend

There is also a While - Wend loop whose logic is identical to the Do-While loop.
This is available for backwards compatibility and should be replaced with a Do - While loop
There is no Exit While in VBA.

Public Sub WhileLoop() 
Dim icount As Integer
   icount = 1
   While (icount < 5)
'do something
      icount = icount + 1
End Sub

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext