I am trying to get my macro to take the date from a cell and autofilter a column so that it only shows cells before the given date.
I have tried:
range("M1"
.select
ActiveCell.FormulaR1C1="=Today()"
a = range("M1"
.value
b = "<" & a
selection.autofilter field:=6, criteria1:=b
When I run this, the autofilter returns nothing, but if you click on the arrow and select custom then click OK (the fields will already be set to "Less than" and today's date) a whole load of lines come up.
Am I missing something obvious?
I have tried:
range("M1"
ActiveCell.FormulaR1C1="=Today()"
a = range("M1"
b = "<" & a
selection.autofilter field:=6, criteria1:=b
When I run this, the autofilter returns nothing, but if you click on the arrow and select custom then click OK (the fields will already be set to "Less than" and today's date) a whole load of lines come up.
Am I missing something obvious?