The following codes only manage to filter for 2 words. (i.e. txt, txt)
When user inputs more than 2 words to filter (i.e. txt, txt, txt), an error just returns.
Is there any workaround to filter more than 2 words, for a particular column?
Thanks!
Thanks a lot!
When user inputs more than 2 words to filter (i.e. txt, txt, txt), an error just returns.
Is there any workaround to filter more than 2 words, for a particular column?
Thanks!
Code:
Sub Test()
iTxt = InputBox("containing : t, t …", Default:=1)
With ActiveSheet
criteria_Arr = Split(iTxt, ",")
For i = LBound(criteria_Arr ) To UBound(criteria_Arr )
criteria_Arr (i) = "*" & criteria_Arr (i) & "*"
Next
selected_addr = Selection.CurrentRegion.Address
.Range(selected_addr).AutoFilter Field:=1, Criteria1:=criteria_Arr , Operator:=xlFilterValues
End With
End Sub
Thanks a lot!