title: How to fix runtime error in VBA For Loop
body: <p>I am executing the following code but getting <strong>error - runtime error - 6 overlfow.</strong></p>
  
  <p>Seams like rowcount is getting the perfect value, i can see when i go to Debug mode. But nothing happening after that.</p>
  
  <p>can some please solve this for me? </p>
  
  <pre><code>Private Sub CommandButton1_Click()
          Dim i As Integer
          Dim RowCount As Long
  
          RowCount = Cells(Rows.Count, "A").End(xlUp).Row
  
          For i = RowCount To 2 Step -1
              If Cells(i, 4) = "7" Then
                  Rows(i).Delete Shift:=xlUp
              End If
          Next i
      End Sub
  </code></pre>