Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default one-tenth of a second delay

hi all

a really useful & simple bit of code introduces a one second delay
within a macro

Range("A1").Select
Application.Wait (Now + TimeValue("0:00:01"))
Range("A1").Select

can anybody trump this with a bit of code that gives a one-tenth of a
second delay please?

or is this the holy grail of code?

rise to the challenge please!?

TIA

matt

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default one-tenth of a second delay

On my website is a link to "Subsecond Wait"

Code here for caching reference:

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub test()
Sleep 500 'wait 1/2 second
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"matt dunbar" wrote in message
...
hi all

a really useful & simple bit of code introduces a one second delay
within a macro

Range("A1").Select
Application.Wait (Now + TimeValue("0:00:01"))
Range("A1").Select

can anybody trump this with a bit of code that gives a one-tenth of a
second delay please?

or is this the holy grail of code?

rise to the challenge please!?

TIA

matt

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default one-tenth of a second delay

Application.wait (now + 0.0000011574074074)
Excel time values are stored to the right of the decimal point of the date.
The whole number is the number of days since 1/1/0 or 1/1/04 (depending
on system )
The fraction after the decimal point is the number of seconds since
midnight divided by
86400. (24 hrs * 60 minutes * 60 seconds = 86400 seconds per day).
Divide any exact time including fractional seconds by 86400 to get its
serial value.



matt dunbar wrote:
hi all

a really useful & simple bit of code introduces a one second delay
within a macro

Range("A1").Select
Application.Wait (Now + TimeValue("0:00:01"))
Range("A1").Select

can anybody trump this with a bit of code that gives a one-tenth of a
second delay please?

or is this the holy grail of code?

rise to the challenge please!?

TIA

matt

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default one-tenth of a second delay

try this
Application.Wait (Now + TimeValue("0:00:01")/2)

it is closer to one tenth of a second. if i remember
correctly i don't think it changes if you increase the 2
value.



-----Original Message-----
hi all

a really useful & simple bit of code introduces a one

second delay
within a macro

Range("A1").Select
Application.Wait (Now + TimeValue("0:00:01"))
Range("A1").Select

can anybody trump this with a bit of code that gives a

one-tenth of a
second delay please?

or is this the holy grail of code?

rise to the challenge please!?

TIA

matt

*** Sent via Developersdex http://www.developersdex.com

***
Don't just participate in USENET...get rewarded for it!
.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default one-tenth of a second delay

As I understand it, Application.Wait does not do resolutions finer than 1
second.
If you ask it to wait until Now+1s, then that point in time may already be
1/2 a second away (or it may be a 1/10 second away or even 9/10 second away)


--
Rob van Gelder - http://www.vangelder.co.nz/excel


" wrote in
message ...
try this
Application.Wait (Now + TimeValue("0:00:01")/2)

it is closer to one tenth of a second. if i remember
correctly i don't think it changes if you increase the 2
value.



-----Original Message-----
hi all

a really useful & simple bit of code introduces a one

second delay
within a macro

Range("A1").Select
Application.Wait (Now + TimeValue("0:00:01"))
Range("A1").Select

can anybody trump this with a bit of code that gives a

one-tenth of a
second delay please?

or is this the holy grail of code?

rise to the challenge please!?

TIA

matt

*** Sent via Developersdex http://www.developersdex.com

***
Don't just participate in USENET...get rewarded for it!
.



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
Delete cells with 0 as the tenth digit PointerMan Excel Worksheet Functions 16 February 9th 09 02:26 PM
Format cells with 0 as the tenth digit PointerMan Excel Worksheet Functions 14 February 9th 09 12:27 AM
How do I set up a formula in excel that is the tenth root of 7 ve. Crescent1 Excel Worksheet Functions 1 October 31st 04 08:40 PM
filling every tenth row Salim Excel Programming 2 December 3rd 03 06:13 PM
Filling every tenth row. Salim Excel Programming 1 December 3rd 03 05:16 PM


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