Delete Rows if contains text in column A

sur

Board Regular
Joined
Jul 4, 2011
Messages
166
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

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
36,012
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,767
Fluff beat me to it. :)
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,090,235
Messages
5,413,233
Members
403,469
Latest member
GRamos

This Week's Hot Topics

Top