title: Deleting content in multiple sheets - Excel VBA
body: <pre><code>Private Sub CommandButton2_Click()
  
  sheetNo = 1
  
  With Worksheets("Sheet" &amp; sheetNo)
  .Range("A1:B12").ClearContents
  End With
  sheetNo = sheetNo + 1
  
  End Sub
  </code></pre>
  
  <p>Assume I have 10 sheets (Sheet1, Sheet2, Sheet 3,........) and when I click CommandButton2 it should delete whatever the content in the range A1:B12. But this code deletes the content only in the Sheet1. can someone tell me why and where have I gone wrong?</p>
  
  <p>Thanks.</p>