Thread
:
Setting autofilter at runtime
View Single Post
#
3
Posted to microsoft.public.excel.programming
AD108
external usenet poster
Posts: 72
Setting autofilter at runtime
Thanks,
That made it work.
"Ardus Petus" wrote in message
...
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
AD108
View Public Profile
Find all posts by AD108