victor
victor

Reputation: 105

Autofilter column based on criteria - number of digits

So far I have tried different autofilter options in but non seems to be working for me, I have license number column which should only have 10 digits in it and by autofilter I am trying to find entries which has less than or more than 10 digits,

I converted that column to text filed in order to use

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

But this doesn't seems to be working as it gives me all the entries including <> &= 10 digits,

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

This also is not working (I changed column to Number filed to match the criteria) can I get any help on whats wrong I am doing here so I can rectify it

Upvotes: 3

Views: 599

Answers (1)

user4039065
user4039065

Reputation:

Use Criteria1 and Criteria2 with Operator:=xlAnd.

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

Upvotes: 4

Related Questions