#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Time Delay

To All,

I have a vba code that seems to be going too fast for its' own good.
When I "Step Into" the code and watch each step slowly, everything
works fine, but when I play the macro it deletes more information that
shouldn't be deleted.

Is there a way to pause the code, say for a few seconds, so that the
computer could "catch up" with itself and not jumble the code?

I know of other code-based programs that do this, and I thought excel
may be able to also.

Thanks much!
Jeff


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Time Delay

Look at Wait in help.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Kilcup " wrote in message
...
To All,

I have a vba code that seems to be going too fast for its' own good.
When I "Step Into" the code and watch each step slowly, everything
works fine, but when I play the macro it deletes more information that
shouldn't be deleted.

Is there a way to pause the code, say for a few seconds, so that the
computer could "catch up" with itself and not jumble the code?

I know of other code-based programs that do this, and I thought excel
may be able to also.

Thanks much!
Jeff


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Time Delay

The following will give .5 sec delay

put the follwoing at the top of the module
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)


'put this where you want the code to pause
sleep 500


But by all rights this wouldn't fix up your problem. It sounds as though
you have got the code looping through more events than you originaly
planned.
I would double check the code. by putting a msgbox near your loop to
doublecheck



"Kilcup " wrote in message
...
To All,

I have a vba code that seems to be going too fast for its' own good.
When I "Step Into" the code and watch each step slowly, everything
works fine, but when I play the macro it deletes more information that
shouldn't be deleted.

Is there a way to pause the code, say for a few seconds, so that the
computer could "catch up" with itself and not jumble the code?

I know of other code-based programs that do this, and I thought excel
may be able to also.

Thanks much!
Jeff


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Time Delay

Thanks for the help... simple answer, but it does the trick. Have
great day.

Jef

--
Message posted from http://www.ExcelForum.com

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
Time formulae - delay updating when the sheet is refreshed Colin Hayes Excel Discussion (Misc queries) 0 April 14th 10 06:24 PM
time delay refresh on random number Bertrand[_2_] Excel Worksheet Functions 2 January 27th 10 01:00 AM
Time delay in displaying charts & chart names hjs40 Charts and Charting in Excel 2 October 21st 07 08:55 PM
Time Delay for Macros [email protected] Excel Discussion (Misc queries) 1 May 15th 07 02:42 PM
Long Time Delay To Paste From UserForm To Sheet Minitman Excel Worksheet Functions 7 December 6th 05 12:30 AM


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