deleting rows containing specific text in 2 columns

amitmk

New Member
Joined
Nov 13, 2017
Messages
2
I am using the AutoFilter code to delete rows wherever a cell in column "E" contains specific text "FILM" .. How do I change this if I want to delete rows which contains "SERIAL" in column E AND contains "ABC" in column L (Need to avoid the loop mode as that takes too long with approx 200,000 rows)


Code which I need to change -

With ActiveSheet
.AutoFilterMode = False
With Range("e1", Range("e" & Rows.Count).End(xlUp))
.AutoFilter 1, "*FILM*"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi, welcome to MrExcel
Give this a go
Code:
With ActiveSheet
    .AutoFilterMode = False
    With Range("A1:L" & Range("E" & Rows.Count).End(xlUp).Row)
        .AutoFilter 5, "SERIAL"
        .AutoFilter 12, "ABC"
        On Error Resume Next
        .Offset(1).SpecialCells(12).EntireRow.Delete
        On Error GoTo 0
    End With
    .AutoFilterMode = False
End With
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,657
Messages
6,120,769
Members
448,991
Latest member
Hanakoro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top