title: Schedule an Excel macro to run at 25 minutes after the hour, unless it was manually run after 00:25
body: <p>I've got a macro that records the time it was run on a worksheet. I want to schedule the macro to run every hour once between 25 minutes and 58 minutes after the hour, unless it was run manually between that time. I've come up with a macro that will handle this but I don't know how to execute the macro, doesn't it need to be running at all times to keep track of things?</p>
  
  <pre><code>Sub auto_download()
  
  when = Application.WorksheetFunction.RoundDown(Now() / TimeSerial(1, 0, 0), 0) * TimeSerial(1, 0, 0) 'current hour
  
  startTime = when + TimeValue("00:25")
  
  lateTime = when + TimeValue("00:58")
  
  myDay = Mid(ThisWorkbook.Sheets("Valu").Range("A66"), 14, 6) 'last updated date string
  myMin = Right(ThisWorkbook.Sheets("Valu").Range("A66"), 5)
  
  myDayDate = CDate(myDay + myMin) 'Serial date of last updated string
  
  If lastUpdated &lt; startTime Then
  Application.OnTime startTime, "Download_raw_obs", lateTime
  End If
  End Sub
  </code></pre>
  
  <p>What is the next step in scheduling this?</p>