Hi guys, I have the next code, this is a real time autofilter on excel
I want to when the text box its clean this filter with criterial "PENDIENTE" o field 15, but this not work, whats wrong?, with the button }works but with clean text box not work.
Code
Option Explicit
Private Sub CommandButton5_Click()
Range("A5").CurrentRegion.AutoFilter Field:=15, Criteria1:= _
"=PENDIENTE"
Hoja1.TextBox1.Value = ""
End Sub
'
Private Sub TextBox1_Change()
Dim Criterio As String
If Hoja1.TextBox1.Value <> "" Then
Criterio = "*" & Hoja1.TextBox1.Value & "*"
Range("A5").CurrentRegion.AutoFilter Field:=6, Criteria1:=Criterio
Else
Criterio = ""
Range("A5").CurrentRegion.AutoFilter Field:=15, Criteria1:= _
"=PENDIENTE"
End If
End Sub
Display More