Delete Rows if contains text in column A

sur

Board Regular
Joined
Jul 4, 2011
Messages
167
Hello All,

Need a macro to delete rows if text equals to ("BB", "CCC","DDDD") in column A.
 

Some videos you may like

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
38,597
Office Version
365
Platform
Windows
How about
Code:
Sub sur()
    With ActiveSheet
        .Range("A1").AutoFilter 1, Array("BB", "CCC", "DDDD"), xlFilterValues
        .AutoFilter.Range.Offset(1).EntireRow.Delete
        .AutoFilterMode = False
    End With
End Sub
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
8,903
Fluff beat me to it. :)
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,095,430
Messages
5,444,402
Members
405,280
Latest member
Galliganr0

This Week's Hot Topics

Top