View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default Calculating times under the second

Hi Sergio,

If you're running a PC and not a Mac, then the Timer function should work
for you:

Sub test()
Dim a As Single
Dim b As Single

a = Timer
Application.Wait Now + TimeSerial(0, 0, 5)
b = Timer
Range("A1").Value = b - a
End Sub

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


SergioBS wrote:
Hi Everybody!

One question:

I want to calculate the time elapsed from a certain moment, for this
purpose I stored in "A" the value of Now() at the "start" and I read
again and Stored in "B" the value of Now() at the "Stop".

Although I have used the following to format the cell:
Selection.NumberFormat = "mm\:ss.00;@"

in the following statement:
Range("A1")= B-A

I cannot read in A1 any value under the second... how is it possible
to count also that small times?

Thank you for your help

Sergio