Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
N+ N+ is offline
external usenet poster
 
Posts: 34
Default wait function

hi all, i need to make this loop for a macro with a wait function that avoid
the cpu to go 100%

loop
.... .. .. .. ..
... .. . . ...
while A1=ON


ty if u can help me
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default wait function

Let's take your code and split it into two parts:

1. Macro1 that is run before the "wait"
2. Macro2 that will be run after the "wait"
3. Include an Event macro ( either Change or Calculate) to monitor cell A1

3a. Set Application.EnableEvents=False
3b. Run Macro1 - the last thing Macro1 does is to EnableEvents and then exit
3c. The Event macro will detect the A1 < ON occurance
3d. The Event Macro will call Macro2

The "wait" happens without VBA spinning in a loop

--
Gary''s Student - gsnu200768


"N+" wrote:

hi all, i need to make this loop for a macro with a wait function that avoid
the cpu to go 100%

loop
... .. .. .. ..
.. .. . . ...
while A1=ON


ty if u can help me

  #3   Report Post  
Posted to microsoft.public.excel.programming
N+ N+ is offline
external usenet poster
 
Posts: 34
Default wait function

do while...

...loop !!
ty p im gonna work on it !



"Gary''s Student" wrote:

Let's take your code and split it into two parts:

1. Macro1 that is run before the "wait"
2. Macro2 that will be run after the "wait"
3. Include an Event macro ( either Change or Calculate) to monitor cell A1

3a. Set Application.EnableEvents=False
3b. Run Macro1 - the last thing Macro1 does is to EnableEvents and then exit
3c. The Event macro will detect the A1 < ON occurance
3d. The Event Macro will call Macro2

The "wait" happens without VBA spinning in a loop

--
Gary''s Student - gsnu200768


"N+" wrote:

hi all, i need to make this loop for a macro with a wait function that avoid
the cpu to go 100%

loop
... .. .. .. ..
.. .. . . ...
while A1=ON


ty if u can help me

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
60 Second Countdown NOT using the WAIT function... Trevor Williams Excel Programming 18 October 28th 09 05:13 AM
sendkeys(keys,wait) how do I use wait MM Excel Discussion (Misc queries) 1 February 11th 09 03:47 PM
Wait function in Excel 2000 Macro fryb53 Excel Discussion (Misc queries) 3 January 16th 08 02:49 PM
Wait less than a second Claus[_3_] Excel Programming 3 September 7th 05 01:25 PM
wait Eddie[_4_] Excel Programming 3 November 15th 03 03:37 PM


All times are GMT +1. The time now is 09:53 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"