Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I'm trying to make delete all rows that DO NOT contain the text "Enter" in
column F. I need to use a wildcard - as a number of cells contain additional data. I have tried a few different methods based upon research from this site, but I'm am struggling to change the following, to delete rows that DO NOT contain the required text. For i = 672 To 1 Step -1 If Cells(i, "J") Like "*Enter*" Then Rows(i & ":" & i).Delete Next i |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Try
Sub MyMacro() Dim lngRow As Long For lngRow = Cells(Rows.Count, "F").End(xlUp).Row To 1 Step -1 If Not Range("F" & lngRow) Like "*Enter*" Then Rows(lngRow).Delete End If Next End Sub -- Jacob "Max2073" wrote: I'm trying to make delete all rows that DO NOT contain the text "Enter" in column F. I need to use a wildcard - as a number of cells contain additional data. I have tried a few different methods based upon research from this site, but I'm am struggling to change the following, to delete rows that DO NOT contain the required text. For i = 672 To 1 Step -1 If Cells(i, "J") Like "*Enter*" Then Rows(i & ":" & i).Delete Next i |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
For i = 672 To 1 Step -1
'Added the UCase argument to eliminate case-sensitivity If Not (UCase(Cells(i, "J").Value) Like "*ENTER*") Then Rows(i).EntireRow.Delete End If Next i -- Best Regards, Luke M "Max2073" wrote in message ... I'm trying to make delete all rows that DO NOT contain the text "Enter" in column F. I need to use a wildcard - as a number of cells contain additional data. I have tried a few different methods based upon research from this site, but I'm am struggling to change the following, to delete rows that DO NOT contain the required text. For i = 672 To 1 Step -1 If Cells(i, "J") Like "*Enter*" Then Rows(i & ":" & i).Delete Next i |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hpw do I delete multiple empty rows found between filled rows? | Excel Worksheet Functions | |||
Searching Multiple rows using VLOOKUP with wildcard(*,?) lookup va | Excel Worksheet Functions | |||
How to Delete empty rows in excel in b/w rows with values | Excel Worksheet Functions | |||
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows | Excel Worksheet Functions | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions |