![]() |
data feed
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?? .. |
data feed
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" wrote: 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?? . |
data feed
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" wrote: 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?? . . |
All times are GMT +1. The time now is 12:06 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com