Hello,
I am trying to use VBA to filter multiple criteria by using the array function, however I am still getting an error saying the process can't be carried out.
The first column with data in it (Column B = Field 1) just has some terms such as LPV, LPA, LPG, LPT, LPZ. However I only want what's in the criterial array below.
The other column with data in it (Column C = Field 2) has numbers, but I only want numbers less than or equal to 10. See the code below.
Sub AutoFilter1()
With ActiveSheet
.AutoFilterMode = False
With Range("B1:C1")
.AutoFilter Field:=1, Criteria1:=Array("LPV", "LPA", "LPG"), Operator:=x1FilterValues
.AutoFilter Field:=2, Criteria1:="<=10"
End With
End With
End Sub
I am trying to use VBA to filter multiple criteria by using the array function, however I am still getting an error saying the process can't be carried out.
The first column with data in it (Column B = Field 1) just has some terms such as LPV, LPA, LPG, LPT, LPZ. However I only want what's in the criterial array below.
The other column with data in it (Column C = Field 2) has numbers, but I only want numbers less than or equal to 10. See the code below.
Sub AutoFilter1()
With ActiveSheet
.AutoFilterMode = False
With Range("B1:C1")
.AutoFilter Field:=1, Criteria1:=Array("LPV", "LPA", "LPG"), Operator:=x1FilterValues
.AutoFilter Field:=2, Criteria1:="<=10"
End With
End With
End Sub
Last edited: