I'm working in Excel 2010 and have problems capturing the autofilter state if the filter is date. In all the other case the filter can be captured by code like this In Excel VBA, how do I save / restore a user-defined filter? In Excel 2010 there is a possibility of a seperate filter for date. In this case the Criterium1 is f.e. like "01.01.2017" if you choose equal. But Excel also offers the possebility to choose the year, the month an the day seperately. In this case the criterium is set as an array. The macro recorder shows in this case this code:
ActiveSheet.Range("$A$1:$A$4").AutoFilter Field:=1, Operator:=
xlFilterValues, Criteria2:=Array(1, "1/1/2016")
There is no Criteria1 (I tested to get it despite the recorder result) but it exists an Operator and the criteria2 as Array. Now I tried several methods but I can't get this Array from Criteria2. It's also impossible to get the dimension of this array or anything else. Is it possible to capture this array and work with it (f.e. set later again or the same filter in an other sheet)? If you choose further days the Array can be longer and has the structure Array(1, "1/1/2016",2,"1/5/2016")
Thanks for any help or advice
Matthias