I've got a date attribute in "dd\mm\yyyy" format in a sheet and I'm trying write a macro, which filters plus minus 7 days from TODAYS date.
For example If today's date is 14/06/2016 my filter range will be 07/06/2016 to 21/06/2016.
I specifically need help with adding and subtracting from today's date and displaying the filter.
For example If today's date is 14/06/2016 my filter range will be 07/06/2016 to 21/06/2016.
I specifically need help with adding and subtracting from today's date and displaying the filter.
Code:
Dim tMinusSeven As String
tMinusSeven = Date
Dim tPlusSeven As String
tPlusSeven = Date
ActiveWorkbook.Sheets("Sheet1").ListObjects("Table1").Range.<wbr>AutoFilter field:=11, Criteria1:=">=" & tMinusSeven -7[COLOR=#333333], _
Operator:=xlAnd, Criteria2:=[/COLOR]"<=" & tPlusSeven -7