title: VBA Button to Clear a Range of Cells
body: <p>As the title states, I am trying to create a button to clear a range of cells. Prior to clearing the cells, I have a dialog box pop up to confirm the selection. Here is my code: </p>
  
  <pre><code>Private Sub CommandButton1_Click()
  
      If MsgBox("THIS WILL CLEAR EVERYTHING IN THE CART! Are you sure?", vbYesNo) = vbNo Then Exit Sub
  
      Range("A28:AA47").ClearContents
  
  End Sub
  </code></pre>
  
  <p>The code works when I'm in Design Mode and press "Play" but the button won't work on my sheet when I'm out of Design Mode.</p>
  
  <p>Is the code completely ending itself when I select "No", to the point where it will not run again even if I hit the button again?</p>