Can someone please help me with this? I've looked all around and I haven't found a reason why this code would not work. I keep getting a Type mismatch error on the "If Not Range..." row.
[vba]
Dim LR As Long, i As Long
LR = Range("B" & Rows.Count).End(xlUp).Row
For i = LR To 1 Step -1
If Not Range("B" & i).Value Like "*Manor*" Then Rows(i).Delete
Next i
[/vba]
This is part of a bigger macro but I can't get past this - the code should go through column B and any row where the cell in column B doesn't have the word "Manor" in it should be deleted.
Thanks for your help! This is really irritating!
Edit: I've added "IsError" in front of Range("B"...) and now my issue is that it is deleting everything. Even if the cell contains the word "Manor", it still deletes it.