View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Nicodemus Nicodemus is offline
external usenet poster
 
Posts: 14
Default userform multitask ?

Great. It works perfectly !

Thank you for this fast & efficient response.

Nicodemus

"RB Smissaert" wrote:

Yes, you can do that.

for example:

for i = 1 to 1000
DoEvents
If bPause then
Do While bPause = True
DoEvents
Loop
end if
'run code here
Loop

In a button:
bPause = True

In other button:
bPause = False

The essential bit are the DoEvents statements, so it can respond to your
button clicks.

RBS


"Nicodemus" wrote in message
...
hello,

I wish to be able to click a button on my userform while the code is
running, and when the button is clicked to run another module.
example : a loop would check each cell from column A, and when the user
would click a "Pause" button, the loop would stop until the user click a
"Play" button.

Is this possible ?