Gday
Wonder if anyone of you kind folks could help? Looking for a VBA to delete rows which contain a B, D, F, K, L, M, N,S O, X, Z as the first letter of the cell data in column A.
The below is what I have so far and works only if I remove the wildcard from after the letters in the array.
Sub DeleteRows()
Application.ScreenUpdating = False
Rows(1).EntireRow.Insert
Range("A1").Value = "Temp"
With Columns("A")
. AutoFilter Field:=1, Criteria1:=Array("B*", "D*", "F*", "K*", "L*", "M*", "N*", "O*", “S*”, "X*", "Z*"), Operator:=xlFilterValues
Rows("2:" & Rows.Count).EntireRow.Delete
.AutoFilter
End With
Rows(1).EntireRow.Delete
Application.ScreenUpdating = True
End Sub
<strike>
</strike>Thanking you kindly
Wonder if anyone of you kind folks could help? Looking for a VBA to delete rows which contain a B, D, F, K, L, M, N,S O, X, Z as the first letter of the cell data in column A.
The below is what I have so far and works only if I remove the wildcard from after the letters in the array.
Sub DeleteRows()
Application.ScreenUpdating = False
Rows(1).EntireRow.Insert
Range("A1").Value = "Temp"
With Columns("A")
. AutoFilter Field:=1, Criteria1:=Array("B*", "D*", "F*", "K*", "L*", "M*", "N*", "O*", “S*”, "X*", "Z*"), Operator:=xlFilterValues
Rows("2:" & Rows.Count).EntireRow.Delete
.AutoFilter
End With
Rows(1).EntireRow.Delete
Application.ScreenUpdating = True
End Sub
<strike>
</strike>Thanking you kindly