I have been trying to get an autofilter with an array working correctly. I have to filter a very large sheet by 30 or more criteria. I receive a new file each week and the information varies. I created a macro based off of the posts I found on here. I am just learning VBA so I only get the basics. The problems I am having with the code is it filters everything out. If I changed the Operator to xlOr it only gives me the first two in the array.
Below is the code that I have. I basically need to filter column I by certain words that start the text in those cells. I only have three criteria in the code because I wanted to get it working before I added all the others. I need to be able to clear the filter and work with the other data also. The autofilter would be perfect, but it only allows for 2 criteria. Any help is appreciated or if you have a different solution that would work I would like to see it. Thanks!
Sub Web_Search3()
Dim Myarray() As Variant
Myarray = Array("Apache*", "Tomcat*", "Web Server*")
ActiveSheet.Range("$A$1:$S$9873").AutoFilter Field:=9, Criteria1:= _
Myarray, Operator:=xlFilterValues
End Sub
Below is the code that I have. I basically need to filter column I by certain words that start the text in those cells. I only have three criteria in the code because I wanted to get it working before I added all the others. I need to be able to clear the filter and work with the other data also. The autofilter would be perfect, but it only allows for 2 criteria. Any help is appreciated or if you have a different solution that would work I would like to see it. Thanks!
Sub Web_Search3()
Dim Myarray() As Variant
Myarray = Array("Apache*", "Tomcat*", "Web Server*")
ActiveSheet.Range("$A$1:$S$9873").AutoFilter Field:=9, Criteria1:= _
Myarray, Operator:=xlFilterValues
End Sub