ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Wait Seconds and Tenths (https://www.excelbanter.com/excel-programming/379960-re-wait-seconds-tenths.html)

Zone

Wait Seconds and Tenths
 
JLG, I think I figured it out. Help says that in Windows, Timer
returns fractional seconds, and on the Mac the Timer resolution is 1
second. Since I'm on a PC, I decided to combine the seconds and the
fractional part into one mixed number. This SEEMS to work! Cheers,
James

Sub myTest()
TestTimer 0.5
End Sub

Sub TestTimer(myWait As Single)
Dim start
start = Timer ' Set start time.
Do While Timer < start + myWait
DoEvents ' Yield to other processes.
Loop
End Sub

JLGWhiz wrote:
I asked this question a few weeks ago and could not find anyone who knew how
to get less than one second. Hope you have better luck, but I don't think
you will find the answer in VBA.

"Zone" wrote:

I want to put a whole number in a cell, say A1, to represent seconds,
and another whole number in a cell, say B1, to represent tenths (or
hundredths) of a second. How do I get my macro to pause for this
amount of time? Please specify type of any variables! Thanks, James





All times are GMT +1. The time now is 08:09 PM.

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