Hey guys ive taken a secion out of my code as below
Now, when there are to rows together both containing a Y the second is ignored and not deleted, i believe this is because the second row then takes on the old row number and excel acts as if it has already checked that cell. I have tryed adding a (-1,0) offset after the delete command but excel still skips to the next row.
Any ideas?
Thanks
Code:
Sub FindFormat()
Dim varMassRange As Range, varCell As Range
Set varMassRange = Range("D2:D500")
For Each varCell In varMassRange
varCell.Select
If Selection.Value = "Y" Then
ActiveCell.EntireRow.Delete
End If
Next varCell
End Sub
Now, when there are to rows together both containing a Y the second is ignored and not deleted, i believe this is because the second row then takes on the old row number and excel acts as if it has already checked that cell. I have tryed adding a (-1,0) offset after the delete command but excel still skips to the next row.
Any ideas?
Thanks