The Sample excel ‘Record’ contains 2 sheets named ‘RTData’ and ‘Datafeed’ resp.
This excel is about recording real time data (stock quote) from trading terminal ODIN Diat.
In Datafeed sheet, we get Time and quote in cells A1 & A2 resp. This is a ‘tick’ data and it refreshes a few times EVERY SECOND.
I wish to record this data in sheet ‘RTData’. Time in col A, & Quote in col B. (for time interval 10 Sec)
After searching the forum, I got the following code:
Sub update()
With Sheets("RTData")
rw = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
.Range(.Cells(rw, 1), .Cells(rw, 2)).Value = Sheets("datafeed").Range("a1:b1").Value
End With
Application.OnTime Now + TimeSerial(0, 0, 10), "update" ' run again after 10 seconds
End Sub
I wish this code / or something better than this (if someone can suggest) with a few modifications:
1. Controls to start and stop recording.
2. Something on ‘error handling’
Can someone please help in this matter ?
Bookmarks