Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default Display constanlty updating time in a cell

Hi,

I am using Excel 2007. I would like to configure a cell so that it will
display the current time. If feasible, I would like this cell to be
automatically updated once per second. I can set the cell formula =Now(),
but this does not get automatically updated. So far, the only way I have
come up with is to create a Sub and use the Application.OnTime function to
call it once per second. (I called this Sub pkPeriodic and I listed it
below).

Anyway, my pkPeriodic Sub does the job, but it makes the user experience
terrible. It is very noticeable that my script is running €“ you can see the
cursor briefly disappear/reappear once per second. This seems to briefly
take control away from the user to the extent that it makes it difficult to
for him/her to use the worksheet.

If anyone can think of a better way I can do this, I would really appreciate
it.

Thanks,
Paul

PS..Here is my Sub pkPeriodic()

Public Sub pkPeriodic()

Application.OnTime EarliestTime:=Now + TimeValue("00:00:01"), _
Procedu="pkPeriodic"
wksParams.Range("CurTime") = Time
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Display constanlty updating time in a cell

hi
see this site...
http://www.mvps.org/dmcritchie/excel/datetime.htm

it a large site, all about dates, time, funcntions about times/dates etc.
good site
but you will be looking for the real time clock towards the bottom.

regards
FSt1

"Paul Kraemer" wrote:

Hi,

I am using Excel 2007. I would like to configure a cell so that it will
display the current time. If feasible, I would like this cell to be
automatically updated once per second. I can set the cell formula =Now(),
but this does not get automatically updated. So far, the only way I have
come up with is to create a Sub and use the Application.OnTime function to
call it once per second. (I called this Sub pkPeriodic and I listed it
below).

Anyway, my pkPeriodic Sub does the job, but it makes the user experience
terrible. It is very noticeable that my script is running €“ you can see the
cursor briefly disappear/reappear once per second. This seems to briefly
take control away from the user to the extent that it makes it difficult to
for him/her to use the worksheet.

If anyone can think of a better way I can do this, I would really appreciate
it.

Thanks,
Paul

PS..Here is my Sub pkPeriodic()

Public Sub pkPeriodic()

Application.OnTime EarliestTime:=Now + TimeValue("00:00:01"), _
Procedu="pkPeriodic"
wksParams.Range("CurTime") = Time
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default Display constanlty updating time in a cell

Thanks FSt1 -

The method on the dmcritchie site is pretty much the same as the method I
was using (using the Application.OnTime function to call a Sub that updates
the cell once per second). dmcritchie has a warning against doing this
because it steals cycles and causes a noticeable slowdown - this is exactly
the problem I was experiencing. It is good to know that someone more
knowledgeable than I am has noticed the same thing.

The slowdown is too noticeable for what I am trying to do. As an
alternative, I have found a DDE server that has a tag for the system time. I
have started experimenting with this and my time is updating once per second
and I do not notice any noticeable slowdown for the user. I am very pleased
so far. I don't know if I will run into any problems as I progress
further...but I will see.

Thanks again for your help,
Paul


--
Paul Kraemer


"FSt1" wrote:

hi
see this site...
http://www.mvps.org/dmcritchie/excel/datetime.htm

it a large site, all about dates, time, funcntions about times/dates etc.
good site
but you will be looking for the real time clock towards the bottom.

regards
FSt1

"Paul Kraemer" wrote:

Hi,

I am using Excel 2007. I would like to configure a cell so that it will
display the current time. If feasible, I would like this cell to be
automatically updated once per second. I can set the cell formula =Now(),
but this does not get automatically updated. So far, the only way I have
come up with is to create a Sub and use the Application.OnTime function to
call it once per second. (I called this Sub pkPeriodic and I listed it
below).

Anyway, my pkPeriodic Sub does the job, but it makes the user experience
terrible. It is very noticeable that my script is running €“ you can see the
cursor briefly disappear/reappear once per second. This seems to briefly
take control away from the user to the extent that it makes it difficult to
for him/her to use the worksheet.

If anyone can think of a better way I can do this, I would really appreciate
it.

Thanks,
Paul

PS..Here is my Sub pkPeriodic()

Public Sub pkPeriodic()

Application.OnTime EarliestTime:=Now + TimeValue("00:00:01"), _
Procedu="pkPeriodic"
wksParams.Range("CurTime") = Time
End Sub


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
Enter number in a cell and it is to display time. Peter Excel Worksheet Functions 2 May 21st 08 08:28 AM
how can i display the date and time of a cell entry in excel? Alex76 Excel Discussion (Misc queries) 3 January 3rd 08 03:11 PM
Find value every time it appears and display cell above Sarah (OGI) Excel Worksheet Functions 1 August 17th 07 05:24 PM
if a cell contains text, then display date and time cassandra112 Excel Discussion (Misc queries) 7 August 9th 06 10:10 PM
Cell showing the time auto updating M. Neves Excel Discussion (Misc queries) 3 February 23rd 06 01:30 PM


All times are GMT +1. The time now is 10:22 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"