Test_MrExcel.xlsx | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | MOD | CO | ← Search Inputs | ||||
2 | TYPE | Single | |||||
3 | SIZE | ||||||
4 | POWER | 2,2 | |||||
5 | |||||||
6 | |||||||
7 | ITEM | MOD. | TYPE | SIZE | POWER | ||
8 | 1 | AZ 566 TFF | Electrical Single | 5" | 2,5 KW | ||
9 | 2 | AZ 586 TFT | Electrical Double | 25 mm | 2000 W | ||
10 | 3 | AV 586 FFT | Electrical Double | 8" | 3 KW | ||
11 | 4 | CO 144 BRD | Mechanical Single | 3" | 2,2 HP | ||
12 | 5 | CO 366 TFD | Mechanical Single | 4" | 2,8 HP | ||
13 | 6 | CO 928 TFT | Hydraulic Double | 50 mm | 15 N | ||
14 | 7 | AV 799 FRR | Electrical Phased | 75 mm | 1,6 Kw | ||
15 | 8 | KQ 66 RRTF | Mechanical Phased | 10" | 2,8 HP | ||
16 | 9 | PSN 888 JKK | Electrical Single | 200 mm | 2000 w | ||
17 | 10 | PSN 566 BRD | Hydraulic Tempo | 50 mm | 10 N | ||
18 | 11 | DR1 978 99 | Phased Milling | 5" | 3 Kw | ||
19 | 12 | DR3 926 55 | Termal Uni | 32" | Deriv | ||
Test 2 |
Good evening,
I am extremely unexperienced, and looked around all day, forgive me if it is a very simple solution, and or it has already being asked multiple times.
I am trying to use the cell range C1:C4 to input partial matches of what i would like to filter from the table.
So far I could come up with a VBA simple code, but only works for exact match and only if all fields are filled with a positive match:
Dim ws1 As Worksheet
Set ws1 = Sheets("TEST2")
With ws1.Range("A7:E19")
.AutoFilter Field:=2, Criteria1:=ws1.Range("C1").Value
.AutoFilter Field:=3, Criteria1:=ws1.Range("C2").Value
.AutoFilter Field:=4, Criteria1:=ws1.Range("C3").Value
.AutoFilter Field:=5, Criteria1:=ws1.Range("C4").Value
End With
I tried (found on another forum) another code supposed to match "partially" the string for the filter:
Dim ws1 As Worksheet
Set ws1 = Sheets("TEST2")
With ws1.Range("A7:E19")
.AutoFilter Field:=2, Criteria1:="*" & ws1.Range("C1").Value & "*"
.AutoFilter Field:=3, Criteria1:="*" & ws1.Range("C2").Value & "*"
.AutoFilter Field:=4, Criteria1:="*" & ws1.Range("C3").Value & "*"
.AutoFilter Field:=5, Criteria1:="*" & ws1.Range("C4").Value & "*"
End With
Does not work.
All I need is to input some key words in the search areas and filter the data accordingly without having to perfect match, or filling all fields. Like if there was a way to tell the Filter Array (that you can manually click selecting/deselecting check boxes) to use a call value as the filter selection. I Cannot create a separate Data table, I need to filter the existing one, as other other columns will have data full of formulas I need to keep.
Hope I made enough sense, explaining what I'm trying to accomplish, and thanks a million for the support.