Hi Guys
i'm using the following to autofilter a field by month
this works perfect if all the data in the master sheet is from the same year
what I need to do is specify the month and the year so that it only returns records that are from a specific month and a specific year
The field number 5 has a date and time in it in the following format
"03/07/2013 10:47:56"
i need to set a variable as follows
I cant for the life of me work out how to specify the two criteria and return the correct number of records
any ideas
mark
i'm using the following to autofilter a field by month
Code:
Worksheets("Master").Range("$A:$AB").AutoFilter Field:=5, Criteria1:=xlFilterAllDatesInPeriodJuly, Operator:=xlFilterDynamic
this works perfect if all the data in the master sheet is from the same year
what I need to do is specify the month and the year so that it only returns records that are from a specific month and a specific year
The field number 5 has a date and time in it in the following format
"03/07/2013 10:47:56"
i need to set a variable as follows
Code:
reportmonth = "7" ;EG July
reportyear = "2013"
I cant for the life of me work out how to specify the two criteria and return the correct number of records
any ideas
mark
Last edited by a moderator: