Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User initiated break/actions during macro execution


Hi,

I'm trying to build an Excel (2000) application for teaching kid
about the normal curve in statistics. Essentially, the program draw
repeated random samples from a column of data and then plots the mean
of each sample (the more samples you draw, the closer the chart wil
look like a normal curve).

Right now I've got the main code set up in a "for...next" loop tha
loops through 1,000 times. But I'd like to set the macro up to run i
an infinite loop until the user presses a stop button. Is such a thin
possible? Mentally, I'm imagining the code as "do until the use
presses button." But I can't figure out if it's possible for a use
event to halt an action rather than initiate it. Can anyone help m
out?

A sub-problem to this is that I'd like to allow the user to adjust th
speed of the macro as it runs (the idea being, the first couple time
through the user might want the program to pause briefly between loop
to discuss it with his/her students but then speed it up to build th
graph quickly). I figured I'd just put a spinner control on th
spreadsheet and tie it to some sort of "wait" or "ontime" code in m
main macro. But the same problem exists as in the paragraph above: ho
to allow users initiated actions DURING macro execution.

Anyone know how I can get the functionality I'm looking for or am
dreaming?

Thanks,
Martin Barro

--
mbarro
-----------------------------------------------------------------------
mbarron's Profile: http://www.excelforum.com/member.php...fo&userid=1484
View this thread: http://www.excelforum.com/showthread.php?threadid=26472

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default User initiated break/actions during macro execution

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



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
want user to input informartion to control mnacro actions looker Excel Discussion (Misc queries) 1 March 2nd 09 04:16 PM
Subtotal Macro weird actions Bill[_22_] Excel Programming 4 August 5th 04 07:05 PM
cant stop OnTime initiated macro, etc Bob Phillips[_6_] Excel Programming 4 April 30th 04 10:33 PM
How to hide all the actions while a macro is running milo[_2_] Excel Programming 3 October 4th 03 03:29 AM


All times are GMT +1. The time now is 01:32 AM.

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"