M
magmike
In the code of my sheet, it returns only rows where the field is exactly what B2 is, but I want partial matches or contained matches to result - i.e. 'fal' would return "Idaho Falls","Buffalo" and "Falls Church". How would I modify this code?
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A2:B2")) Is Nothing _
Then Exit Sub
Dim myRange As Range
'Set the range of your table
Set myRange = Range("A4:E100")
If Target <> "" Then
myRange.AutoFilter field:=Target.Column, Criteria1:=Target
Else
myRange.AutoFilter field:=Target.Column, Criteria1:="<>"
End If
End Sub
Thanks in advance for your help,
magmike
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A2:B2")) Is Nothing _
Then Exit Sub
Dim myRange As Range
'Set the range of your table
Set myRange = Range("A4:E100")
If Target <> "" Then
myRange.AutoFilter field:=Target.Column, Criteria1:=Target
Else
myRange.AutoFilter field:=Target.Column, Criteria1:="<>"
End If
End Sub
Thanks in advance for your help,
magmike