title: How to loop through rows in VBA (Excel)
body: <p>I want to loop through a lot of data—5,734 rows to be exact. This is what I want to do for all rows:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Private Sub CommandButton1_Click()
  a = Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).row
  
  Range("A2:A14").Copy Range("D2:D14")
  ("B2:B14").Copy Range("D15:D27")
  Range("C2:C14").Copy Range("D28:D40")
  </code></pre>