0% found this document useful (0 votes)
6 views1 page

TextBox1 Change Event for Filtering

This code filters a table range based on text entered into a text box. It uses AutoFilter on the table's range to filter the first column based on the text box value.

Uploaded by

lamsaco
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

TextBox1 Change Event for Filtering

This code filters a table range based on text entered into a text box. It uses AutoFilter on the table's range to filter the first column based on the text box value.

Uploaded by

lamsaco
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Sub TextBox1_Change()

'Update by Extendoffice 2018/08/22

Dim xStr, xName As String

Dim xWS As Worksheet

Dim xRg As Range

On Error GoTo Err01

[Link] = False

xName = "Name"

xStr = [Link]

Set xWS = ActiveSheet

Set xRg = [Link](xName).Range

If xStr <> "" Then

[Link] field:=1, Criteria1:="*" & xStr & "*", Operator:=xlFilterValues

Else

[Link] field:=1, Operator:=xlFilterValues

End If

Err01:

[Link] = True

End Sub

You might also like