Excel Vba : Filtering Using Text Boxes
A nice filtering template.
The value in textbox is searched as part or whole in the column.
The results found are shown in the column, the other data are hidden.
A section of code:
Private Sub CommandButton2_Click()
Dim aCell As Range, bCell As Range
Dim SearchString As String, son As Long
Dim RngOne As Range, cell As Range
On Error GoTo Whoa
If TextBox3.Value = Empty Then
MsgBox "Please, Enter A Value To Textbox", vbCritical, ""
Exit Sub
End If
ActiveSheet.Range("A3:K3").AutoFilter
Range("AN:AN").Clear
Sheets("Data").Cells.EntireRow.Hidden = False
SearchString = TextBox3.Value
Range("F:F").Activate
Select Case TextBox3.Value
Case "?"
TextBox3.Value = "~?"
Case "*"
TextBox3.Value = "~*"
Case "%"
GoTo bura_a
Case "="
GoTo bura_a
Case IsNumeric(TextBox3)
GoTo bura_a
End Select
....
Post Your Ad Here
Comments