Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default Programmed pause

I have a rather long code that essentially loops through two workbooks and
copies indicated data from one to another. Everything works fine when I use a
break to view the results for each item in the loop, but I get undesirable
results when I remove the break.

How can I program a short pause (about 1 second) prior to "Next" in my loop?

Thanks,

Sam
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Programmed pause

My general comment would be that there is probably another underlying reason
for the error but if you must then try this

Application.Wait Now + TimeValue("00:00:1")

Gives a 1 second pause

Mike

"Sam" wrote:

I have a rather long code that essentially loops through two workbooks and
copies indicated data from one to another. Everything works fine when I use a
break to view the results for each item in the loop, but I get undesirable
results when I remove the break.

How can I program a short pause (about 1 second) prior to "Next" in my loop?

Thanks,

Sam

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Programmed pause

On Apr 8, 1:44*pm, Sam wrote:
I have a rather long code that essentially loops through two workbooks and
copies indicated data from one to another. Everything works fine when I use a
break to view the results for each item in the loop, but I get undesirable
results when I remove the break.

How can I program a short pause (about 1 second) prior to "Next" in my loop?

Thanks,

Sam


Dim PauseTime, StartTime

PauseTime = 1 ' Set duration (seconds)
StartTime = Timer ' Set start time.
Do While Timer < StartTime + PauseTime
'do nothing
Loop

'Continue with code


HTH

Chris
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
Programmed error messages Lee Excel Programming 2 October 4th 07 03:38 PM
programmed hyperlinks nadznadz Excel Programming 1 July 13th 06 01:18 PM
Programmed Autofilter Query Ron McCormick Excel Programming 0 March 9th 06 04:17 PM
Programmed ComboBoxes Phil Hageman[_3_] Excel Programming 0 May 12th 04 06:51 PM
Excel menu programmed in .Net through PIA Avi Farah Excel Programming 0 November 10th 03 02:57 PM


All times are GMT +1. The time now is 08:23 PM.

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

About Us

"It's about Microsoft Excel"