Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Userform to enter values and shown in same userform in list | Excel Programming | |||
Looping procedure calls userform; how to exit loop (via userform button)? | Excel Programming | |||
Activating userform and filling it with data form row where userform is activate | Excel Programming | |||
Access from add_in userform to main template userform.... | Excel Programming | |||
Linking userform to userform in Excel 2003 | Excel Programming |