Thread
:
Setting autofilter at runtime
View Single Post
#
2
Posted to microsoft.public.excel.programming
Ardus Petus
external usenet poster
Posts: 718
Setting autofilter at runtime
Selection.AutoFilter Field:=12, Criteria1:="<=" & Now
HTH
--
AP
"AD108" a écrit dans le message de news:
...
Hello,
I am trying to set an autofilter to a custom filter when a user clicks
command button. The code I have linked to the button follows. The goal
is
to get the autofilter to return rows where the date in the field is less
than or equal to today. I think I can see that the problem is that the
code
is seeing the string "=Now" as a literal string without evaluting the
expression within it.
Dim lDate As Date
Selection.AutoFilter Field:=12, Criteria1:="<= Now", Operator:=xlAnd
End Sub
Any help would be greatly appreciated.
Reply With Quote
Ardus Petus
View Public Profile
Find all posts by Ardus Petus