Found these code snippets and they work - you can alter the recording range and the seconds between records to whatever you want.
Can anyone help me adjust these please so that it starts recording on auto-bind and clears the data ready for the next market on auto-clear.
i only want to record from 4 minutes out until post time, and restart automatically on each new market.
'This code should go in a regular module sheet, and won't work properly if installed anywhere else. _
The next (Dim) statement must occur before any subs or functions.
Dim NextTime As Double
Dim Interval As Double
Dim cel As Range, Capture As Range
Interval = 5 'Number of seconds between each recording of data
Set Capture = Worksheets("Sheet1").Range("A1:A5") 'Capture this column of data
With Worksheets("Sheet2") 'Record the data on this worksheet
Set cel = .Range("A2") 'First timestamp goes here
Set cel = .Cells(.Rows.Count, cel.Column).End(xlUp).Offset(1, 0)
cel.Value = Now
cel.Offset(0, 1).Resize(1, Capture.Cells.Count).Value = Application.Transpose(Capture.Value)
NextTime = Now + Interval / 86400
Application.OnTime NextTime, "RecordData"
On Error Resume Next
Application.OnTime NextTime, "RecordData", , False
On Error GoTo 0
'These subs must go in ThisWorkbook code pane. They won't work at all if installed anywhere else!
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Private Sub Workbook_Open()
Discussion regarding the spreadsheet functionality of Bet Angel.
6 posts • Page 1 of 1