M
Marles McDonald
I am trying to create a timing loop that updates data periodically until
a condition is met.
The text data is imported onto ashee from a Data Acquistion system every
5 minutes I need to calculate results from a subset of that data and
when certain conditions are met end the macro. Currently I just assign a
zero to each of the conditional results if true, if all are true the
sum_check is zero.
The timing loop needs to :
operate once
check the sum check cell
if the sum check (error_sum) is zero, exit
if the sum check is greater than zero then wait 5 minutes and operate
then loop until error_check is zero
then exit
I have tried the following which works if error_sum is zero
but gets me an endless loop and ends up using all my system resources if
the error_sum is 1
Sub Timed_Loop()
Do
error_sum = Worksheets("MONITOR").Range("B27")
Application.OnTime Now + TimeValue("00:05:00"), " Get_early_data"
Loop Until error_sum = 0
End Sub
I don't do this often and expect that I am missing something dead simple.
Any help would be appreciated.
Marles
a condition is met.
The text data is imported onto ashee from a Data Acquistion system every
5 minutes I need to calculate results from a subset of that data and
when certain conditions are met end the macro. Currently I just assign a
zero to each of the conditional results if true, if all are true the
sum_check is zero.
The timing loop needs to :
operate once
check the sum check cell
if the sum check (error_sum) is zero, exit
if the sum check is greater than zero then wait 5 minutes and operate
then loop until error_check is zero
then exit
I have tried the following which works if error_sum is zero
but gets me an endless loop and ends up using all my system resources if
the error_sum is 1
Sub Timed_Loop()
Do
error_sum = Worksheets("MONITOR").Range("B27")
Application.OnTime Now + TimeValue("00:05:00"), " Get_early_data"
Loop Until error_sum = 0
End Sub
I don't do this often and expect that I am missing something dead simple.
Any help would be appreciated.
Marles