title: Deleting an Array of rows and columns
body: <p>I've got some reports which have sub-totals littered inbetween them. I need to delete the sub-totals, which is easy enough to condition on (as is in my IF statement).</p>
  
  <p>However, my following code just does not delete the entire row of subtotals. </p>
  
  <pre><code>Sub clean_up()
  'declare variables
  Dim i As Integer
  Dim noRows As Integer
  
  'count rows
  noRows = Range("B2:B387").Rows.Count
  
  'delete row entries that are duplicates..
  For i = 1 To noRows
      If Range("B2").Cells(i + 1, 1) = Range("B2").Cells(i, 1) Then
      Range("B2:G2").Cells(i + 1).Clear
  
  
      End If
  Next i
  
  End Sub
  </code></pre>
  
  <p>I do not understand why the <code>Range("B2:G2").Cells(i + 1).Clear</code> of my code is incorrect. Using <code>Range("B2").Cells(i + 1).Clear</code> works to delete the first entry in the row, so shouldn't <code>Range("B2:G2").Cells(i + 1).Clear</code> delete the entire row?</p>