Hello dear community,
I use following VBA to delete entire row if cell contains "6" or "7"
But now I want to add a lot more criterias. Is it possible to delete entire row if cells A40:A3000 contains any value from range B1:B40 ?
I use following VBA to delete entire row if cell contains "6" or "7"
But now I want to add a lot more criterias. Is it possible to delete entire row if cells A40:A3000 contains any value from range B1:B40 ?
VBA Code:
Dim rng As Range
Set rng = ActiveSheet.Range("A40:A3000")
For i = rng.Cells.Count To 1 Step -1
If rng.Item(i).Value = "6" Or rng.Item(i).Value = "7" Then
rng.Item(i).EntireRow.Delete
End If
Next i