Awebber1993
New Member
- Joined
- Jun 26, 2018
- Messages
- 2
I'm trying to create a macro which allow me to remove a row if it contains an exact word. When I extract data, the column may contain the word "Renewal" or "Renewal & Additional". What I'm trying to achieve is to remove all the rows that contain the word "Renewal" and not the rows that contain "Renewal & Additional". So far I have come across this coding and it will remove all rows that contain the word "Renewal", is there a way is can be adjusted?
With ActiveSheet
.AutoFilterMode = False
With Range("e1", Range("e" & Rows.Count).End(xlUp))
.AutoFilter 1, "*Renewal*"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
With ActiveSheet
.AutoFilterMode = False
With Range("e1", Range("e" & Rows.Count).End(xlUp))
.AutoFilter 1, "*Renewal*"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With