ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pause a macro by resetting current time (https://www.excelbanter.com/excel-programming/427001-re-pause-macro-resetting-current-time.html)

Gary''s Student

Pause a macro by resetting current time
 
Sub servient()
Application.Wait Now() + 0.000005787037
End Sub
--
Gary''s Student - gsnu200846


"SW" wrote:

Hi, I am creating a macro which changes the y-values in a distribution plot
each second (corresponding to the values the next day). This allows one to
see a distribution change over time. The problem I have is I found the
following code to pause in between (so one can see the distribution shifting
over time) the dates but it pauses it for 1 second and I need it to pause it
for about half a second only.
Here is the code (for pausing) that I currently have:
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 1
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

Any help greatly appreciated, thanks a million!
SW



All times are GMT +1. The time now is 11:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com