data feed

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

i have a data feed into my excel spreadsheet.

the feed is to one cell that changes continuously in real
time. there is no historical record of the path taken by
the numbers displayed - only the most current number is
displayed.

I would like to record these numbers at periodic intervals
so as to create a historical record of the numbers
appearing in the data feed cell and make a chart depicting
the history of the data.

is ther a way to do such a thing in excel??
..
 
Following would write a log on a change counter..

in worksheet code module

Dim iNum As Integer

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.address = "$A$4" Then
iNum = iNum + 1
If iNum = 1000 Then
[log!a65000].End(xlUp).Offset(1) = [a4]
iNum = 0
End If
End If
End Sub


or you could put following in a module

(keeping track of nextRun is necessary to cancel it..
and dont forget to stop the timer when you close the book!!

see VBA help for the Ontime method.


Dim nextRun As Date

Sub InitTimer()
nextRun = Now + TimeSerial(0, 10, 0)
Application.OnTime nextRun, "WriteLog"
End Sub

Sub StopTimer()
applicaiton.OnTime nextRun, "WriteLog", , False
End Sub

Sub WriteLog()
[log!a65000].End(xlUp).Offset(1) = [data!a4]
InitTimer
End Sub


untested...


keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
Just a quick word of warning.

You can also create a timer object and run that. However
DON"T use this method as if you are editing a cell in an
excel workbook and the timer event is triggered then all
excel spreadsheets are instantly shut down with no warning.

Derek
-----Original Message-----
Following would write a log on a change counter..

in worksheet code module

Dim iNum As Integer

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.address = "$A$4" Then
iNum = iNum + 1
If iNum = 1000 Then
[log!a65000].End(xlUp).Offset(1) = [a4]
iNum = 0
End If
End If
End Sub


or you could put following in a module

(keeping track of nextRun is necessary to cancel it..
and dont forget to stop the timer when you close the book!!

see VBA help for the Ontime method.


Dim nextRun As Date

Sub InitTimer()
nextRun = Now + TimeSerial(0, 10, 0)
Application.OnTime nextRun, "WriteLog"
End Sub

Sub StopTimer()
applicaiton.OnTime nextRun, "WriteLog", , False
End Sub

Sub WriteLog()
[log!a65000].End(xlUp).Offset(1) = [data!a4]
InitTimer
End Sub


untested...


keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >


Paul said:
i have a data feed into my excel spreadsheet.

the feed is to one cell that changes continuously in real
time. there is no historical record of the path taken by
the numbers displayed - only the most current number is
displayed.

I would like to record these numbers at periodic intervals
so as to create a historical record of the numbers
appearing in the data feed cell and make a chart depicting
the history of the data.

is ther a way to do such a thing in excel??
.

.
 
Back
Top