title: How to add a 'Stop Macro' in excel-vba?
body: <p>I have a simple macro and a button to start running it. I would like to also have a button to stop it, so I don't have to have the vba editor open to do it.</p>
  
  <p>Here's the code.</p>
  
  <pre><code>Sub Data_Recording()
  
      With Workbooks("Chart_Macro").Sheets("Chart")
          .Rows(5).EntireRow.Insert Shift:=xlDown, 
          CopyOrigin:=xlFormatFromLeftOrAbove
          .Range("B5:F5").Value = .Range("B2:F2").Value
      End With
  
      Application.OnTime Now + TimeValue("00:00:20"), "Data_Recording"
  
      End Sub
  </code></pre>
  
  <p>Thanks a lot.</p>