ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Timer question (https://www.excelbanter.com/excel-discussion-misc-queries/214679-timer-question.html)

teepee[_3_]

Timer question
 

If I do

Range ("a1") = timer

on a loop then it refreshes showing fractions of a second, but shows
whatever large number the timer is at


However if i do


tim = Timer
Do

diff = Timer - tim
Range("a1") = diff

loop

then it counts up from zero, as intended, but for some reason drops all the
decimal places

Anyone know why it drops the decimals and how to make it keep the decimals?

Many thanks



mikeaj72[_4_]

Timer question
 

Check your other post


--
mikeaj72
------------------------------------------------------------------------
mikeaj72's Profile: http://www.thecodecage.com/forumz/member.php?userid=46
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=44334


Jim Cone[_2_]

Timer question
 

tim and diff need to be declared as Single or Double.
Integer and Long carry no decimal places.
--
Jim Cone
Portland, Oregon USA



"teepee"
wrote in message
If I do
Range ("a1") = timer

on a loop then it refreshes showing fractions of a second, but shows
whatever large number the timer is at
However if i do
tim = Timer
Do
diff = Timer - tim
Range("a1") = diff
loop

then it counts up from zero, as intended, but for some reason drops all the
decimal places
Anyone know why it drops the decimals and how to make it keep the decimals?
Many thanks



teepee[_3_]

Timer question
 
Thanks for the help




All times are GMT +1. The time now is 07:17 PM.

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