title: Ending a subroutine after a message box
body: <p>I am trying to figure out how to end my macro if you were to press no. However, before the macro has ended, I want to to run code. If the user were to press "yes", the code should proceed as normal. Here is my code:</p>
  
  <pre><code>Sub main()
  
      Call GriffinC_ISM_Table ' This Macro will create the pivot tables
  
      If MsgBox("Have you run this macro before", vbYesNo) = vbNo Then Call Spark_Table End Sub
  
      Call Extraps
  
  End Sub
  </code></pre>
  
  <p>As you can see from this code, if the user presses no, I want to run the code "Spark_Table" and then end the sub. However, if the user presses "yes", I want to run the code "Extraps". Any help would be greatly appreciated.</p>
  
  <p>Thanks,</p>
  
  <p>G</p>