for...next and criteria1

J

jafeol

Hello,

Could someone tell me why the following code doesn't work:

Dim Code
For Code := 1 To 13
Selection . Autofilter Field := 3 , Criteria1 := Code, Operator :
xlAnd
......
Next

It always stops at the line with Criteria1

Thank you

F
 
C

cucchiaino

Could someone tell me why the following code doesn't work:

Dim Code
For Code := 1 To 13

For Code=1 To 13
Selection . Autofilter Field := 3 , Criteria1 := Code, Operator :=
xlAnd

Selection.AutoFilter Field:=3, Criteria1:=Code
 
Top