Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,365
Default induce sleeping time

This code from a PowerPoint tips site should work just as well in Excel,
sometimes VBA is just VBA <g
http://www.pptfaq.com/FAQ00466.htm


"ALVESM" wrote:

that wont work i'll tell you why. I absolutely must have my macro sleeping
because if the macro is running, then the DDE links are not updated.

"Mike H" wrote:

Hi,

Put this couple of lines of code where you want to pause:-

Sub delayingtactics()
PauseTime = 2 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
Loop
Finish = Timer
End Sub

Mike

"ALVESM" wrote:

i want to have this macro sleeping 2s (during that time PXLAST will hopefully
get updated via DDE) until the condition is verified, can you help me out?
thanks in advance


Sub Macro1()

Dim i As Integer

For i = 1 To 1000
Do While Worksheets("sheet1").Range("pxlast").Value =
Worksheets("sheet1").Range("init").Offset(i - 1, 0).Value

Sleep 2000 / this wont work

Loop
Worksheets("sheet1").Range("pxlast").Copy
Worksheets("sheet1").Range("init").Offset(i, 0).PasteSpecial
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Next

End Sub

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 calculations for Scheduled Time vs. Actual Time Worked The Caterer Excel Discussion (Misc queries) 1 November 29th 09 08:08 AM
straight time, time and a half, and double time Jeremy Excel Discussion (Misc queries) 3 September 23rd 08 09:03 PM
Calculate Ending time using Start Time and Elapsed Time Chief 711 Excel Worksheet Functions 5 May 13th 08 04:34 PM
Formula to find Stop Time from Start Time and Total Minutes Jonathan Bickett Excel Worksheet Functions 5 March 7th 07 05:22 PM
Calculating days & time left from start date/time to end date/time marie Excel Worksheet Functions 7 December 7th 05 02:36 PM


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