P
Peter H
Hi, I have a most likely easy question that is absolutely
stumping me.
Let's say I have two columns of data. Whenever the data
in columnA is zero, I want to delete (clear contents) that
entire row of data. Thus, if cell A40 was zero, B40 would
be deleted as well.
I don't even care of the rest of the data is shifted up
with a delete. My problem is that when I run the macro,
it misses a bunch of the zeros that it was supposed to
detect. Any help?
Here's what I'm working with:
Sub delete()
For rwIndex = 1 To 200
With ActiveSheet.Cells(rwIndex, 1)
If ((.Value) = 0) Then
Rows(rwIndex).delete
End If
End With
Next rwIndex
End Sub
stumping me.
Let's say I have two columns of data. Whenever the data
in columnA is zero, I want to delete (clear contents) that
entire row of data. Thus, if cell A40 was zero, B40 would
be deleted as well.
I don't even care of the rest of the data is shifted up
with a delete. My problem is that when I run the macro,
it misses a bunch of the zeros that it was supposed to
detect. Any help?
Here's what I'm working with:
Sub delete()
For rwIndex = 1 To 200
With ActiveSheet.Cells(rwIndex, 1)
If ((.Value) = 0) Then
Rows(rwIndex).delete
End If
End With
Next rwIndex
End Sub