[xpost][/xpost]
Hi
I am using:
Excel version 2016 (16.0) (Build 13628.20380) 32 bit
Windows 10 Pro version 2009 (20H2) (Oct 2020) Build 19042 64 bit
i am trying to write vba code to filter on multiple non consecutive dates, but I haven't been successful.
so I did what I thought should be very simple:
I have a worksheet with the below data starting in cell(1,1) (rows with date entries are formatted as m/d/yyyy):
date
3/1/2021
2/25/2021
2/24/2021
2/23/2021
When I use the macro recorder to create an autofilter macro, it creates it as:
ActiveSheet.range("$A$1:$A$5").AutoFilter Field:=1, Operator:= _
xlFilterValues, Criteria2:=Array(1, "2/25/2021")
and the data is correctly filtered. but when I remove the filter and then manually run the macro, it gives error:
Number: 1004
Description: AutoFilter method of Range class failed
I have tried multiple other ways but can't get any autofilter with dates and array to work.
I have read MANY googled items, but haven't found the solution.
Anyone know what's wrong ?
Thanks