Triggering an macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Group,
I need to trigger a macro to run every 15 seconds, for a total of ten times.
I have the macro below, but it only delay the 15 seconds on the first pass
through.

Sub AUTO()
'This routine is for auto operation of data collection. It will
'run the data collection routine MANUAL, the choosen number of
'times

'Gets the number of data points to be collected
data_points = Worksheets("ALCOHOL").Range("L7").Value

'Setup FOR - NEXT loop to cycle through number of data points
For cycles = 1 To data_points

'Gets time from SLC 500 in hours,minute,seconds
slc_time = Worksheets("ALCOHOL").Range("L6").Value

'Delays data collection by one minute from current slc_time
Application.OnTime slc_time + TimeValue("00:00:15"), "MANUAL"

Next cycles
End Sub

Any ideads?
Regards
Blank
 
I would create another subroutine that would call your other one like this:

Sub Run_Macro()
For x = 1 to 15
Call Auto
next x
End Sub

You would then run the above program instead of "Auto".
Hope this helps.
 
Al,

I would suggest that you add an OnTime statement in the called macro that
fires itself at a later time, using a public variable to count the calls.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Back
Top