LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel! How can I use a variable in an autofilter in VBA?

I want to use a variable as the criteria for an autofilter.
What I have is this:
ActiveSheet.Range("$A$1:$S$277").AutoFilter Field:=1,
Criteria1:="=StartDate", Operator:=xlAnd, Criteria2:="<=EndDate"
where StartDate and EndDate would be assigned date values to filter between
those dates. Results are no records as the variable name is used instead of
the value of the variable.
Variables are dim'ed as variants.
Thanks.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2007 autofilter change to 2003 autofilter functionality? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 10:05 PM
2007 excel autofilter back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 3 April 19th 10 08:11 PM
2007 excel autofilter change back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 05:53 PM
autofilter with variable criteria dr chuck Excel Programming 2 October 16th 06 03:48 PM
Variable in AutoFilter criteria morry[_28_] Excel Programming 1 June 30th 04 04:48 AM


All times are GMT +1. The time now is 07:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"