Milliseconds in Excel

C

ccdubs

Hi,

Is there any way to get the millisecond value of the system clock in Excel.

All help much appreciated.
 
B

Bernard Liengme

One of the Time formats is mm:ss.0.
In a cell I enter =NOW() and used this format then I use Custom format to
have mm:ss.000
But every time I pressed F9 the last digit was 0, so I guess the system
clock counts only in centiseconds
 
P

Paul B

You can give this a try

Sub time()
' will display time in 100th of a seconds
Selection.NumberFormat = "hh:mm:ss.00"
ActiveCell.Formula = "=NOW()"
ActiveCell.Value = ActiveCell.Value
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
 
J

jaf

Hi,
Read this post. The link is no longer valid but the mmtimer is still around.



--
John
johnf 202 at hotmail dot com


| Thanks for that Bernard.
|
| Any idea how I can access that value in VB?
|
| | > One of the Time formats is mm:ss.0.
| > In a cell I enter =NOW() and used this format then I use Custom format
to
| > have mm:ss.000
| > But every time I pressed F9 the last digit was 0, so I guess the system
| > clock counts only in centiseconds
| >
| > --
| > Bernard Liengme
| > www.stfx.ca/people/bliengme
| > remove CAPS in e-mail address
| >
| >
| > | > > Hi,
| > >
| > > Is there any way to get the millisecond value of the system clock in
| > Excel.
| > >
| > > All help much appreciated.
| > >
| > >
| >
| >
|
|
 
C

ccdubs

Thanks for the help.

I found a function posted on the internet called GetTickCount which accesses
the system clock.

As all I wanted to do was run a macro at fixed ms intervals I also found a
function called sleep which allows ms inputs.

Declare Function GetTickCount Lib "Kernel32" () As Long
Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
 

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