Basically i am doing a search, where a user selects an option from several lists and then using autofilters the search is performed on those selected items. The problem that is arising is that i have a "don't know" option in the lists, which means that when this is selected i still want the search to just include all the options for that item, or leave it out of the filter some how.
So if i have 3 fields:
Strength Ductility Luminostiy
hard ductile light
weak brittle dark
dont know don't know dont know
Lets say for the first field, hard is selected, and for the second field ductile is selected and for the third field dont know is selected.
so when searching i can just pass on the text from the first two options but for the 3rd option i dont know what to do, i was thinking of passing an asterisk (*) as the search item but i dont think this will work. the code is
If strengthComboBox.Text = "Dont Know" Then
strength = "*"
Else
strength = strengthComboBox.Text
End If
With Sheet1
.AutoFilterMode = False
With .Range("A1:D1")
.AutoFilter
.AutoFilter Field:=1, Criteria1:=strength
End With
End With
So if i have 3 fields:
Strength Ductility Luminostiy
hard ductile light
weak brittle dark
dont know don't know dont know
Lets say for the first field, hard is selected, and for the second field ductile is selected and for the third field dont know is selected.
so when searching i can just pass on the text from the first two options but for the 3rd option i dont know what to do, i was thinking of passing an asterisk (*) as the search item but i dont think this will work. the code is
If strengthComboBox.Text = "Dont Know" Then
strength = "*"
Else
strength = strengthComboBox.Text
End If
With Sheet1
.AutoFilterMode = False
With .Range("A1:D1")
.AutoFilter
.AutoFilter Field:=1, Criteria1:=strength
End With
End With