Hello,
I would like to fileter data by a date column and 2 limit parameters.
Basically, I want to select the line for which the date in column G is between today - nb1 (nb1 number of days) and today - nb2 (nb2 number of days).
So I use the following code to filter it :
Range("A1:Ag1").Select
Selection.AutoFilter Field:=7, Criteria1:=">=" & Date - nb2, Operator:=xlAnd, Criteria2:=" < " & Date - nb1
The problem is, no line is selected.
Then I check manually the filter, I can see the two limit dates and when I apply the filter again (without changing dates), the line appear.
I just do not understand why it does not work with the macro in the first place.
Would any of you have a solution?
Thanks in advance!
Louis
Bookmarks