Wait number of seconds in A1

C

CLR

Hi All......
If someone would be so kind.......how can this code be modified to "wait"
the number of seconds corresponding to the value in A1?

Application.Wait Now() + 0.000005787037

TIA
Vaya con Dios,
Chuck, CABGx3
 
C

CLR

Hi All..........

Never mind.......I always get smarter as soon as I post a question....

Application.Wait Now() + Range("a1").Value / 86400

Vaya con Dios,
Chuck, CABGx3
 
W

Walter Briscoe

In message <[email protected]> of Sun, 5 Jul 2009
21:59:41 in microsoft.public.excel.programming, Howard31
Try this:
Application.Wait Now() + Range("A1").Value

I would not do it that way. YMMV.

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
....
Sleep Range("A1").Value*1000 ' Untested
 
C

CLR

Thanks for the comeback Walter, but the other way works just fine, once I
got it straightened out........do you see some hidden danger with this
method?

Vaya con Dios,
Chuck, CABGx3
 
W

Walter Briscoe

In message <[email protected]> of Mon, 6 Jul 2009
11:21:26 in microsoft.public.excel.programming, CLR
Thanks for the comeback Walter, but the other way works just fine, once I
got it straightened out........do you see some hidden danger with this
method?

Not at all! It just makes more sense to me to have code which waits for
two seconds rather that for two seconds from now. (I now they're the
same thing.) As I said, YMMV.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top