I have a macro to filter a sales report. It has been working for over a year. It stopped working. Nothing in the report changed.
I am getting an error at the autofilter line. I am trying to filter 3 criteria values in one field (3 dates).
I tried to record a macro filtering the report. When I run it I get
Runtime error: 1004 "AutoFilter method of Range class failed".
Here is the recorded line below, I had changed some of the values in my code to have variables instead of hardcoding but I posted this for testing purpose. I made sure the report is not filtered before trying to autofilter.
ActiveSheet.Range("$A$1:$M$1").AutoFilter Field:=2, Operator:= _
xlFilterValues, Criteria2:=Array(2, "2/5/2021", 2, "2/6/2021", 2, "2/7/2021")
