Code:
Sub checknewentries()
If Workbooks("trend_strat").Worksheets("trend10").Range("AI1").Value < Workbooks("trend_strat").Worksheets("trend10").Range("AI2").Value Then
Workbooks("trend_strat").Worksheets("recordings").Range("E2:WF100").Value = Workbooks("trend_strat").Worksheets("recordings").Range("D2:WE100").Value
Workbooks("trend_strat").Worksheets("recordings").Range("WG2:WG100").Cells.Clear
Dim i As Integer
For i = 0 To 40
If Workbooks("trend_strat").Worksheets("trend10").Range("Z2").Offset(i, 0).Value > 0 Then
Call SendOrder(i+2)
End If
Next
ActiveWorkbook.Save
Workbooks("trend_strat").Worksheets("trend10").Range("AI1").Value = Workbooks("trend_strat").Worksheets("trend10").Range("AI1").Value + 1
alertTime = Now + TimeValue("00:00:03")
Application.OnTime alertTime, "checknewentries"
End If
End Sub
Right now the code simply copies a set of values every 3 seconds over to the next column, and it also checks every 3 seconds if a cell is bigger than 0 so that it can Call another macro named Sendorder.
The above code works fine, but I'm wondering if it's possible to do the "Call SendOrder" part on a different period (other than 3 seconds). I actually need excel to immediately Call SendOrder when the celll value that it is looking at is above zero, not to check for it potentially 3 seconds later. Would it be wise to make excel keep scanning for the cell value change every, say, half a second? if so, how do I incorporate two different loops? Is there another way of doing what I need?
Thanks!