The code below doesn't work because it constantly skips rows that should be deleted. I used to have a code that would search the defined range from the bottom up and that seemed to work. But even better would be if I could define a range as the entirerow of all cells in Range(top,btm) that don't equal str, and then delete that range of non-contigous cells al at once. That would be my preferred way of doing it.
How do I write that?
Application.ScreenUpdating = False
Dim top As Range, btm As Range, rng As Range, str As String
str = ActiveCell.Value
Set top = [D7]
Set btm = [D10000].End(xlUp)
Set rng = Range(top, btm)
For Each cel In rng
If cel <> str Then cel.EntireRow.Delete
Application.ScreenUpdating = True