• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel dynamic search vba code

photoshopper

New Member
With this vba macro for excel i get instant search filter when i type the whole word. But i want it as following, when i type (O) for opel, that i get opel already showing.

This is the code:

Code:
Private Sub TextBox1_Change()
Dim Ray As Variant
If Len(TextBox1.Value) = 0 Then
    Sheet1.AutoFilterMode = False
    Else
        If Sheet1.AutoFilterMode = True Then
            Sheet1.AutoFilterMode = False
        End If
    Ray = Split(TextBox1, "+")
    Sheet1.Range("A2:F" & Rows.Count).AutoFilter field:=1, Criteria1:=Ray, Operator:=xlFilterValues 
    End If

End Sub


This is the test file:

https://drive.google.com/open?id=1KDwE2jT_u35wPhd5dR7Xi3X31ddzXDNx
 
Back
Top