Passing a named varaible to Excel's Autofilter
Dim FWDATE as DATE
FWDATE = DateValue("10/25/2003")
Selection.AutoFilter field:=10,Criteria1:="" & clng(FWDATE"), _
Operator:=xlAnd
Not sure what you mean by a date named FWDATE. I will assume FWDATE is a
variable of type DATE that has been assigned a value.
--
Regards,
Tom Ogilvy
"Jeff Glock" wrote in message
...
Does anyone know how to use a variable name in these sorts
of statements?
Selection.AutoFilter field:=14, Criteria1:="<*R*",
Operator:=xlOr, _
' Criteria2:="<*H*"
and
Selection.AutoFilter field:=14, Criteria1:="=(Blank)",
Operator:=xlAnd
Work for finding records that contain blanks or do not
contain "R" or "H". However, given a variable for a date
named "FWDATE", the statement;
Selection.AutoFilter field:=10,Criteria1:"FWDATE",
Operator:=xlAnd
does not work.
Any help would be appreciated.
|