Hi everyone.
I have a monthly task which requires i apply a complex series of custom filters to a spreadsheet and extract the data. I thought it would be cool to automate the filters to ensure consistency. Most of the filters include date-filtering i.e. in the current month, before the current month, etc.
First i recorded a macro applying some of the filters. Looking at the code I can see the dates hard-coded (as I entered them) e.g.
but it would be best for me to automate these dates. So I created cells with formulas that return the dates I will need. However, I am unsure how to replace the hardcoding with the cell ref so that it comes out correctly formatted etc.
Can anyone help please?
I have a monthly task which requires i apply a complex series of custom filters to a spreadsheet and extract the data. I thought it would be cool to automate the filters to ensure consistency. Most of the filters include date-filtering i.e. in the current month, before the current month, etc.
First i recorded a macro applying some of the filters. Looking at the code I can see the dates hard-coded (as I entered them) e.g.
Code:
Selection.AutoFilter Field:=3, Criteria1:=">=11/01/2009", Operator:=xlAnd _
, Criteria2:="<=11/30/2009"
Can anyone help please?