Delete Rows using If and Wildcard

M

Max2073

I'm trying to delete all rows that DO NOT contain the text "ENTER" in column
F.
I have tried a few different methods based upon research from this site, but
I'm struggling to change them, to delete all rows that DO NOT contain the
"ENTER". I need to use the wildcard as most of the cells contain additional
data. How can I change this to delete rows that DO NOT contain the "ENTER"

For i = 672 To 1 Step -1
If Cells(i, "J") Like "*UASGN*" Then Rows(i & ":" & i).Delete
Next i


Thanks.
 
D

Don Guillett

Sub findenter()
For i = Cells(Rows.Count, "f").End(xlUp).Row To 1 Step -1
If InStr(UCase(Cells(i, "f")), "ENTER") < 1 Then rows(i).delete 'MsgBox i
Next i
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top