I have the following snippet from my VBA
Dim i As Integer
Dim value As Integer
For i = 1 To 52
ActiveSheet.Range(Cells(1, 1), Cells(lRow, 11)).AutoFilter Field:=1, Criteria1:=i
Next i
End Function
I know there is something wrong here
1) If I record a macro, I get Criteria1:="1" if 1 is not filtered out, Criteria2:="2" if 2 is not filtered out and so on...
How can I get 1 through 52 in a loop so that I can have 1,2,...52 not filtered out sequentially and do tasks I subsequently want to carry out?
Is the above approach correct. I think its wrong because I set Criteria1:=i and i is an integer above
Whereas, in the recorded macro, 1 or 2 or...appear in double quotes "1", or "2",....
Can anyone help to Set Criteria1 as a variable because I want to filter out 52 times (1 first time, 2 second time, 3 third time,.....52 52nd time)
Thanks a lot in advance
Bookmarks