ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   delays in macros (https://www.excelbanter.com/excel-programming/283544-re-delays-macros.html)

Bob Phillips[_6_]

delays in macros
 
Sorry, small error, it should be

Application.Wait (Now + TimeValue("0:00:10"))

--

HTH

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

"Bob Phillips" wrote in message news:...
Matt,

Use Wait, for example

Application.Wait (Now + Time("0:00:10"))

waits 10 seconds.

--

HTH

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

"Matt Dunbar" wrote in message
...
Hi

does anyone know a good way of producing a delay in a macro
so that it reveals hidden objects and data and waits
between lines of code over a defined time period?

i have used a bit of code below which produces a delay of
approx 1 second - however this runs much faster than 1
second on some faster colleagues computers

For z = 1 To 2000
Range("a1").Select
Next z

as an alternative i also used the code below which produces
a one second delay but i cannot adapt it to produce
fraction of a second delays

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 1
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

any advice greatly appreciated to give exact 1/4, 1/2 and
whole second delays

regards

matt - a maths teacher in manchester, england








All times are GMT +1. The time now is 04:17 AM.

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