I have a value 'cDate' in a sheet called Values. It stores today date.
A macro is doing a autofilter on date in column 8 based on cDate:
When I run this macro, the autofilter returns nothing. All rows are hidden. BUT when i open the autofilter selection and then press enter, correct rows are displayed.
Is there another workaround for doing this commitment in the macro??
A macro is doing a autofilter on date in column 8 based on cDate:
Code:
sub autofilter()
cperiod = Sheets("Values").Range("cDate")
Selection.Autofilter Field:=8, Criteria1:=">" & cperiod, Operator:=xlAnd _
, Criteria2:="<" & cperiod + 7
End sub
When I run this macro, the autofilter returns nothing. All rows are hidden. BUT when i open the autofilter selection and then press enter, correct rows are displayed.
Is there another workaround for doing this commitment in the macro??