ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Delete Rows using If and Wildcard (https://www.excelbanter.com/excel-worksheet-functions/259058-delete-rows-using-if-wildcard.html)

Max2073

Delete Rows using If and Wildcard
 
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.

Jacob Skaria

Delete Rows using If and Wildcard
 
Check your other post
--
Jacob


"Max2073" wrote:

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.


Don Guillett[_2_]

Delete Rows using If and Wildcard
 
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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Max2073" wrote in message
...
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.




All times are GMT +1. The time now is 10:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com