Let me start off by trying to explain what I am trying to accomplish.
I have a column of data that updates occasionally from a RTD data feed. Each cell in the column updates at different times. I would like a timer to start in the column to the right of data when the data is updated. The timer would reset to 0 when an update occurs and the process would start over.
I'm sure that there is an easier way but this is the convoluted process I chose:
BTW- I am using XP Pro Excel 2003 sp2
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 5 Then
ThisRow = Target.Row
If Target.Value <> 0 Then
Range("F" & ThisRow) = Now()
Else
Range("F" & ThisRow) = 0
End If
End If
End Sub
Now this just posted the time that the cell change occurred in the column to the right. I then had a cell somewhere in the sheet tracking the current time through =Now() . I would then subtract the time stamped value of the cell change from the cell where the =Now() was and that was great. I had the timer that I wanted.
My problem is that using the RTD updates are considered Calculations not Changes, so it doesn't work!!!
I know that I need to use the Worksheet_Calculation command but I cannot get it to work at all.
I am worried that I will not be able to accomplish this because it sounds like if there was any calculation in the entire sheet ALL the timer would reset to Zero.
If anyone has any idea of how to accomplish this I am all ears. I would assume there is also an easier and more efficient way of doing this just that I cannot figure it out.
Let me finish by saying that my experience with VB is VERY limited.
Thank you in advance,
Adam
I have a column of data that updates occasionally from a RTD data feed. Each cell in the column updates at different times. I would like a timer to start in the column to the right of data when the data is updated. The timer would reset to 0 when an update occurs and the process would start over.
I'm sure that there is an easier way but this is the convoluted process I chose:
BTW- I am using XP Pro Excel 2003 sp2
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 5 Then
ThisRow = Target.Row
If Target.Value <> 0 Then
Range("F" & ThisRow) = Now()
Else
Range("F" & ThisRow) = 0
End If
End If
End Sub
Now this just posted the time that the cell change occurred in the column to the right. I then had a cell somewhere in the sheet tracking the current time through =Now() . I would then subtract the time stamped value of the cell change from the cell where the =Now() was and that was great. I had the timer that I wanted.
My problem is that using the RTD updates are considered Calculations not Changes, so it doesn't work!!!
I know that I need to use the Worksheet_Calculation command but I cannot get it to work at all.
I am worried that I will not be able to accomplish this because it sounds like if there was any calculation in the entire sheet ALL the timer would reset to Zero.
If anyone has any idea of how to accomplish this I am all ears. I would assume there is also an easier and more efficient way of doing this just that I cannot figure it out.
Let me finish by saying that my experience with VB is VERY limited.
Thank you in advance,
Adam