Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default userform multitask ?

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 ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default userform multitask ?

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 ?


  #3   Report Post  
Posted to microsoft.public.excel.programming
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 ?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform to enter values and shown in same userform in list helmekki[_104_] Excel Programming 0 November 19th 05 03:23 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
Activating userform and filling it with data form row where userform is activate Marthijn Beusekom via OfficeKB.com[_2_] Excel Programming 3 May 6th 05 05:44 PM
Access from add_in userform to main template userform.... Ajit Excel Programming 1 November 18th 04 05:15 PM
Linking userform to userform in Excel 2003 missmelis01 Excel Programming 2 August 27th 04 08:07 PM


All times are GMT +1. The time now is 02:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"