LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 829
Default Update specific cell at a specific time

"CynthiaL" wrote:
Here is my continuous clock macro. My clock is in C4.
My information is in D4 and I want the information to
"snapshot" into E4. Basically what we are trying to do
is for example take a "snapshot" of D4 at let's say
9 am into E4 then every 5 minutes "snapshot D4 into E5
and so on.


Note some additional changes and comments.

Dim SchedRecalc As Date

Sub Recalc()
Range("C3:C4").Clear
Range("C3").NumberFormat = "dd-mmm-yy"
Range("C4").NumberFormat = "hh:mm:ss AM/PM"
Range("C4").Formula = "=C3"
Call SetTime
End Sub

Sub SetTime()
Dim t As Date
' *** update clock time (C4) every 1 sec.
' *** also update clock date (C3) in case
' *** run time spans midnight
t = Now
Range("C3") = t
' *** no need to treat 9:00 AM as a special case.
' *** it is one of "every 5 minutes" after midnight
If Minute(t) Mod 5 = 0 Then Range("E4") = Range("D4")
SchedRecalc = t + TimeValue("00:00:01")
Application.OnTime SchedRecalc, "Recalc"
End Sub

Sub Disable()
On Error Resume Next
Application.OnTime EarliestTime:=SchedRecalc, _
Procedu="Recalc", Schedule:=False
End Sub



 
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
Cell Update only at a specific time. Scott520 Excel Discussion (Misc queries) 4 August 8th 13 08:41 PM
Highlight a cell after update in a specific range Mark[_71_] Excel Programming 2 April 25th 13 09:34 AM
Send data from userform to specific cell on specific sheet? JennLee Excel Programming 10 March 10th 07 02:55 AM
Link from a specific Cell in Excel to a specific para. in Word CathyK Excel Worksheet Functions 0 August 10th 06 04:40 PM
Update a cell with a specific value related to a date. Jeff Excel Worksheet Functions 5 December 9th 05 06:14 PM


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