Looping, but with Live Data
Hi All-
I'm looking for some ideas on how to simultaneously/continuously
perform calculations in VBA while receiving live data feeds.
I want to run a simple program that has a start and stop button.
Basically, I have a live data feed and want to do calcuations and
perform other functions only after I have pressed the "Start" button
and until I press the "Stop" Button. Pretty simple.
My problem is that I dont know entirely how to set this up.
Currently, I have all of my calcuations and functionality working
correctly, BUT my program is set up to call a Do Until loop when the
"Start" button is pressed, and therefore, I am not receiving my live
data feeds until I hit "Stop" and it breaks the loop.
My code is basic and as follows:
Worksheet:
Private Sub ResetButton_Click()
Worksheets("Front").Range("B3") = ""
End Sub
Private Sub StopButton_Click()
Worksheets("Front").Range("B3") = ""
Call MyCalcs(TRUE)
End Sub
Private Sub StartButton_Click()
Call MyCalcs(FALSE)
End Sub
Module1
Sub MyCalcs(StopProg As Boolean)
Do Until StopProg = True
'Instructions, calcuations, etc
DoEvents
'Instructions, calcuations, etc
Loop
End Sub
Can anyone point me in the right direction?
Thanks.
SLL
|