dzogchen
01-27-2020, 05:47 AM
Good morning!
I was wondering if there is any way to check if a number exists in the autofilter, in my code:
If ActiveSheet.range("$A$2:$AF$458" ).AutoFilter(Field:=8, Criteria1:=Textbox1.text) = Null Then GoTo TheEnd
the "Textbox1.text" could be any number. What I realise is if even the Textbox1.text assume a number that aren't in the autofilter the autofilter is turned on anyways and the cell that are writted are all hidden.
If there are a way to check if the Textbox1.text number exists my macro will run faster because i'm using a loop to find information.
Do Until Sheets("Folha1").range("H" & r).Value = ""
...
Loop
but the "If ActiveSheet.range("$A$2:$AF$458" ).AutoFilter(Field:=8, Criteria1:=Textbox1.text) = Null Then GoTo TheEnd" seems that aren't working.
Anyone could help me?
Best regards
I was wondering if there is any way to check if a number exists in the autofilter, in my code:
If ActiveSheet.range("$A$2:$AF$458" ).AutoFilter(Field:=8, Criteria1:=Textbox1.text) = Null Then GoTo TheEnd
the "Textbox1.text" could be any number. What I realise is if even the Textbox1.text assume a number that aren't in the autofilter the autofilter is turned on anyways and the cell that are writted are all hidden.
If there are a way to check if the Textbox1.text number exists my macro will run faster because i'm using a loop to find information.
Do Until Sheets("Folha1").range("H" & r).Value = ""
...
Loop
but the "If ActiveSheet.range("$A$2:$AF$458" ).AutoFilter(Field:=8, Criteria1:=Textbox1.text) = Null Then GoTo TheEnd" seems that aren't working.
Anyone could help me?
Best regards