Hi everybody
I would like to do this one:
For example, i have a command button that will stop a loop.
Do
.......
loop until command button is clicked
How to encode this one ?
Big thanks in advance and Happy New Year !
Printable View
Hi everybody
I would like to do this one:
For example, i have a command button that will stop a loop.
Do
.......
loop until command button is clicked
How to encode this one ?
Big thanks in advance and Happy New Year !
VB Code:
Option Explicit Private StopIt As Boolean Private Sub cmdCancel_Click() StopIt = True End Sub Private Sub cmdDoTheLoop_Click() Dim i As Long For i = 1 to 1000000 'do your loop DoEvents If StopIt = True Then Exit For Next End Sub