Autofilter table based on criteria - number of digits

So far I've tried different options autofilter

, but doesn't seem to work for me, I have a license number that should only contain 10 digits and autofilter

. I am trying to find records that have less than or more than 10 digits,

I converted this column to a textbox to use

ActiveSheet.Range("$A$1:$BN$235").AutoFilter Field:=12, Criteria1:="<>*??????????*"'

But that doesn't seem to work as it gives me all entries including , <> &= 10 digits

I tried too    criteria ``">"10000000000"' &<90000000000

This also doesn't work (I changed the column to Number, filed as per the criteria) can I get any help on what I'm doing here so I can fix it.

+3


source to share


1 answer


Use Criteria1

and Criteria2

with help Operator:=xlAnd

.



with ActiveSheet.Range("$A$1:$BN$235")
    .AutoFilter Field:=12,  Criteria1:=">999999999", Operator:=xlAnd, Criteria2:="<10000000000"
end with

      

+4


source







All Articles