I want to delete rows 3 - 5 if the value in column b (of any of the
respective rows) is zero. Below is the code that I am using but it is
not working. It is leaving one of the "zero rows" in place (it is only
deleting two of the rows when all three should be deleted). Any help
would be greatly appreciated.
Dim myRng As Range
Dim zerocell As Range
Set myRng = Range("b3:b5")
For Each zerocell In myRng
If zerocell.Text = "0" Then
zerocell.EntireRow.Delete
End If
Next
I've also tried this (and I have the same problem):
Dim myRng As Range
Dim zerocell As Range
Set myRng = Range("b3:b5")
For Each zerocell In myRng
If zerocell = 0 Then
zerocell.EntireRow.Delete
End If
Next
_________________
Thanks, TB
--
Tbal
------------------------------------------------------------------------
Tbal's Profile:
http://www.excelforum.com/member.php...o&userid=25317
View this thread:
http://www.excelforum.com/showthread...hreadid=395819