Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default delays in macros

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


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

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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default delays in macros

Hi

have a look at

http://www.decisionmodels.com/downloads.htm

for some material. He has a microtimer which is very
useful.

search on the ng, too

hth

Tim

PS numeracy rules?!




-----Original Message-----
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




.

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
DELAYS when opening spreadsheets containing regular Links Carlos Excel Discussion (Misc queries) 1 October 29th 09 04:59 PM
Delays trans Excel Discussion (Misc queries) 1 January 24th 08 06:27 PM
Shortcut Key Delays [email protected][_2_] Excel Discussion (Misc queries) 0 November 29th 07 11:21 PM
Excel File Open Delays Paul Excel Discussion (Misc queries) 2 April 6th 05 07:47 AM
Excel Delays TomXYZ Excel Discussion (Misc queries) 1 January 13th 05 12:19 PM


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