franksirvent
Programmer
Hi, I have a macro which filters the excel form based on values entered on certain cells
However I am unable to filter between two dates.
The routine below works well, however I need the 20/07/2006 to be a variable (which is foundon CELL D4)
Selection.AutoFilter Field:=2, Criteria1:="<=20/07/2006", Operator:=xlAnd
Selection.AutoFilter Field:=3, Criteria1:=">=20/07/2006", Operator:=xlAnd
I have substituted the 20/07/06 with the following code but doesn't work..
The_date = Range("D4").Value
Selection.AutoFilter Field:=2, Criteria1:="<="" & The_date & "", Operator:=xlAnd
Selection.AutoFilter Field:=3, Criteria1:=">="" & The_date & "", Operator:=xlAnd
Any ideas?????
However I am unable to filter between two dates.
The routine below works well, however I need the 20/07/2006 to be a variable (which is foundon CELL D4)
Selection.AutoFilter Field:=2, Criteria1:="<=20/07/2006", Operator:=xlAnd
Selection.AutoFilter Field:=3, Criteria1:=">=20/07/2006", Operator:=xlAnd
I have substituted the 20/07/06 with the following code but doesn't work..
The_date = Range("D4").Value
Selection.AutoFilter Field:=2, Criteria1:="<="" & The_date & "", Operator:=xlAnd
Selection.AutoFilter Field:=3, Criteria1:=">="" & The_date & "", Operator:=xlAnd
Any ideas?????