Hi All,
I am trying to remove rows where the contents of column G = zero. The code is:
First, the code takes a long time to run through the array, and second, it keeps the first instance where the contents of G is not zero (which happens to be in row 722), but deletes all rows above where the contents of column G = zero.
...so this leaves two questions... is there a faster way to do what I want, and why are the incorrect rows being deleted?
I am trying to remove rows where the contents of column G = zero. The code is:
VBA Code:
Dim arr As Variant: arr = shAnalyzedData.Range("A2:G722")
Dim i As Long
For i = UBound(arr, 1) To LBound(arr, 1) Step -1
If arr(i, 7) = 0 Then
Rows(i).Delete
End If
Next i
...so this leaves two questions... is there a faster way to do what I want, and why are the incorrect rows being deleted?