Hi all,
I have the code below which auto filters a data-set in column 10 based upon a list of values on separate worksheet. The code works perfectly when I'm filtering based on the complete text string, i.e 'computer equipment'.
I'm now trying to modify the code so that I can auto-filter based on a single piece of text within the string, i.e. 'computer' or 'equipment', and not necessarily 'computer equipment'.
I've searched for an answer but can't find anything helpful, any help would be appreciated.
Thanks
David
Option Explicit
Sub FilterByMerchantType()
Dim vCrit As Variant
Dim wsO As Worksheet
Dim wsL As Worksheet
Dim rngCrit As Range
Dim rngOrders As Range
Set wsO = Worksheets("Working Copy")
Set wsL = Worksheets("Lists")
Set rngOrders = wsO.Range("$A$1").CurrentRegion
Set rngCrit = wsL.Range("CritList1")
vCrit = rngCrit.Value
rngOrders.AutoFilter _
Field:=10, _
Criteria1:=Application.Transpose(vCrit), _
Operator:=xlFilterValues
End Sub
Bookmarks