Hi,
New to vba and using it to make macros. I built a macro based off one I found online. It's designed to delete rows if they have certain criteria, but each criteria is in separate auto filter section. Is there a way to list all of the criteria(TV show names) in one "section" ?
Sub DeleteRowsF()
With ActiveSheet
.AutoFilterMode = False
With Range("f1", Range("f" & Rows.Count).End(xlUp))
.AutoFilter 1, "*Big Bang Theory*"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
.AutoFilterMode = False
With Range("f1", Range("f" & Rows.Count).End(xlUp))
.AutoFilter 1, "*Modern Family*"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
.AutoFilterMode = False
With Range("f1", Range("f" & Rows.Count).End(xlUp))
.AutoFilter 1, "*Vanderpump Rules*"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
End Sub
New to vba and using it to make macros. I built a macro based off one I found online. It's designed to delete rows if they have certain criteria, but each criteria is in separate auto filter section. Is there a way to list all of the criteria(TV show names) in one "section" ?
Sub DeleteRowsF()
With ActiveSheet
.AutoFilterMode = False
With Range("f1", Range("f" & Rows.Count).End(xlUp))
.AutoFilter 1, "*Big Bang Theory*"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
.AutoFilterMode = False
With Range("f1", Range("f" & Rows.Count).End(xlUp))
.AutoFilter 1, "*Modern Family*"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
.AutoFilterMode = False
With Range("f1", Range("f" & Rows.Count).End(xlUp))
.AutoFilter 1, "*Vanderpump Rules*"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
End Sub