Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Timer question


tim = Timer
Range("a1").NumberFormat = "0.0"
Do
diff = Timer - tim
Range("a1") = diff
Loop


--
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=44335

  #3   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Timer question

Thanks for the help


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timer question teepee[_3_] Excel Discussion (Misc queries) 3 December 26th 08 07:23 PM
VERY tricky timer question Ryan Ragno Excel Programming 3 June 24th 08 02:12 PM
Stopping a Timer / Running a timer simultaneously on Excel Paul23 Excel Discussion (Misc queries) 1 March 10th 06 12:08 PM
Timer Question Adrian Moore Excel Programming 2 September 18th 05 04:58 PM
timer Mike Macgowan Excel Programming 4 May 24th 05 03:27 AM


All times are GMT +1. The time now is 10:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"