Search with a single TextBox that will filter every column in a table?

54 views Asked by At
Private Sub TextBox1_Change()

texto = "*" & Sheets("bdd").TextBox1.Text & "*"
Range("E5").AutoFilter Field:=5, Criteria1:=texto
Range("F5").AutoFilter Field:=6, Criteria1:=texto
Range("K5").AutoFilter Field:=11, Criteria1:=texto

If Sheets("bdd").TextBox1.Text = "" Then Range("E5").AutoFilter Field:=5
If Sheets("bdd").TextBox1.Text = "" Then Range("F5").AutoFilter Field:=6
If Sheets("bdd").TextBox1.Text = "" Then Range("K5").AutoFilter Field:=11

End Sub

When I write something in my TextBox, it will filter in a way where every column needs to have same values to show me something.

Is it possible to search with just one TextBox in all columns of my table?

A "general searcher" of a table, so if you have three columns (fruit, units, country) and you write "Me" it will show not just Melon (for fruit) but also Mexico (for country) or any entry that has that string.

0

There are 0 answers