Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Shannon,
Assumptions: The time to capture in entered in column B (entered as time only), the value to capture is in column C, and the captured value should be placed in column D (which will be empty until the captured value is place in it). All cells are on the same row, all on just one worksheet, the active worksheet. Copy the code below into a module. Run "StartIt" to start, "StopIt" to stop. Assign the macros to buttons or object for ease of starting and stopping. HTH, Bernie MS Excel MVP Option Explicit Dim NextTime As Date Dim Running As Boolean Sub StartIt() Update End Sub Sub Update() Dim myCell As Range Running = True 'Check every second NextTime = Time + TimeValue("00:00:01") Application.OnTime NextTime, "Update" For Each myCell In Intersect(Range("B:B"), ActiveSheet.UsedRange) If myCell.Value < Time And myCell(1, 3).Value = "" Then myCell(1, 3).Value = myCell(1, 2).Value End If Next myCell End Sub Sub StopIt() If Not Running Then Exit Sub On Error Resume Next Application.OnTime NextTime, "Update", schedule:=False Running = False End Sub "Shannon" wrote in message om... Bernie, Thanks for the reply. Last night I created a function with an module-level array variable (500,6). The funtion dumps a new value to the array if the time is less than or equal to the target snapshot time, else leaves the array alone. Then the funtion returns whatever is in the array. This works, but is pretty slow and is taking up all my cpu processing power. I guess because the array is updating every time one of the 500x6 values changes (about every second), even after the target time has been passed. I'm game to try your macro. Please let me know the next step. Thanks. Shannon |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find %ontime & SUMIF ontime ie: find matching sets within Range... | Excel Worksheet Functions | |||
Snapshot function, 2003 to 2007 | Excel Worksheet Functions | |||
Record changing cell data into a column or range | Excel Worksheet Functions | |||
how do i record changing cell data (cell is dde linked) | Excel Discussion (Misc queries) | |||
Viewing Snapshot Files with Snapshot Viewer Control on Excel Userform...How? | Excel Programming |