I have some interesting issues with the dynamic filtering for multiple columns recently. Also, I have searched all over S/O for solutions but none seems to work:
:Autofilter for multiple columns in excel VBA :VBA for filtering columns :Dynamic filter using excel VBA
Recently, I watch a tutorial of Dynamic Filtering in Excel using VBA (Note: I don't have Microsoft 365, hence Filter functions do not work for me).
What I am trying to achieve is that I just want to use only one text box (Linked at cell C3) to filter out my data (as long as it contains the word typed into textbox) at columns 2,3 and 5 simultaneously when the VBA scripts detects changes in textbox but unfortunately, it does not work. It just filters out all the things leaving the table empty.
Here is the code below
Option Explicit
'Linkedcells is C3
Private Sub TextBox1_Change()
With ListObjects("Search").Range
.AutoFilter Field:=2, Criteria1:="*" & Range("C3") & "*"
.AutoFilter Field:=3, Criteria1:="*" & Range("C3") & "*"
.AutoFilter Field:=5, Criteria1:="*" & Range("C3") & "*"
End With
End Sub
C3cell?Field:=4is number data. Here * will not work. What are you typing in textbox and which result do you want? Share you expected output here.