willow1985
Well-known Member
- Joined
- Jul 24, 2019
- Messages
- 931
- Office Version
- 365
- Platform
- Windows
I know when you filter in excel using "contains" it only gives you 2 criterial options. 1st text AND/OR and 2nd text.
Is there a way to do more than 2?
In my case I would like to do 3.
I would like to filter/get all data that contains these 3 words (and they do not have to be together in 1 cell)
"PLATING", "WELD" and "NDT".
I wrote the below formula but it gives me an error 1004 on the 'criteria line for the filter on Field 6
Help would be greatly appreciated!
Thank you!
Is there a way to do more than 2?
In my case I would like to do 3.
I would like to filter/get all data that contains these 3 words (and they do not have to be together in 1 cell)
"PLATING", "WELD" and "NDT".
I wrote the below formula but it gives me an error 1004 on the 'criteria line for the filter on Field 6
VBA Code:
'Criteria
ActiveSheet.ListObjects("RT").Range.AutoFilter Field:=6, Criteria1:= _
"=*PLATING*", Operator:=xlOr, Criteria2:="=*WELD*", Operator:=xlOr, Criteria3:="=*NDT*"
ActiveSheet.ListObjects("RT").Range.AutoFilter Field:=10, Criteria1:= _
"Yes"
Range("A1:G" & Cells(Rows.Count, 4).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Report").Select
Range("B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Help would be greatly appreciated!
Thank you!