Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Litter you code with the
DoEvents command. another approach would be to restart the code with application.Ontime, but this would beg the question of where you are storing your results. http://www.cpearson.com/excel/ontime.htm Chip Pearson's site. -- Regards, Tom Ogilvy "mbarron" wrote in message ... Hi, I'm trying to build an Excel (2000) application for teaching kids about the normal curve in statistics. Essentially, the program draws repeated random samples from a column of data and then plots the means of each sample (the more samples you draw, the closer the chart will look like a normal curve). Right now I've got the main code set up in a "for...next" loop that loops through 1,000 times. But I'd like to set the macro up to run in an infinite loop until the user presses a stop button. Is such a thing possible? Mentally, I'm imagining the code as "do until the user presses button." But I can't figure out if it's possible for a user event to halt an action rather than initiate it. Can anyone help me out? A sub-problem to this is that I'd like to allow the user to adjust the speed of the macro as it runs (the idea being, the first couple times through the user might want the program to pause briefly between loops to discuss it with his/her students but then speed it up to build the graph quickly). I figured I'd just put a spinner control on the spreadsheet and tie it to some sort of "wait" or "ontime" code in my main macro. But the same problem exists as in the paragraph above: how to allow users initiated actions DURING macro execution. Anyone know how I can get the functionality I'm looking for or am I dreaming? Thanks, Martin Barron -- mbarron ------------------------------------------------------------------------ mbarron's Profile: http://www.excelforum.com/member.php...o&userid=14844 View this thread: http://www.excelforum.com/showthread...hreadid=264727 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
want user to input informartion to control mnacro actions | Excel Discussion (Misc queries) | |||
Subtotal Macro weird actions | Excel Programming | |||
cant stop OnTime initiated macro, etc | Excel Programming | |||
How to hide all the actions while a macro is running | Excel Programming |