msb20
asked on
Double textbox for autofilter
Good morning everyone
i have a list of employee
mainuw.png
i need to make double autofilter means when i click textbox1 it will list the names ,textbox2 will filter the jobs as mentioned in the picture
main2n.png
Doubts:
1- how to search first name and last name means sarah gellar without typing michelle
2- how to make double filter in the textbox2 as mentioned in the second image
the code
any help "I would appreciated.
i have a list of employee
mainuw.png
i need to make double autofilter means when i click textbox1 it will list the names ,textbox2 will filter the jobs as mentioned in the picture
main2n.png
Doubts:
1- how to search first name and last name means sarah gellar without typing michelle
2- how to make double filter in the textbox2 as mentioned in the second image
the code
Sub Macro1()
Dim lastrow As Long
lastrow = Range("b65535").End(xlUp).Row
If ActiveSheet.TextBox1.Text <> "" Then
Range("A3:C3").AutoFilter
ActiveSheet.Range("$A$3:$c$" & lastrow).AutoFilter field:=2, Criteria1:= _
"=" & ActiveSheet.TextBox1.Text & "*", Operator:=xlOr
Else
ActiveSheet.Range("$A$3:$c$" & lastrow).AutoFilter field:=2
End If
End Sub
any help "I would appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks alot