View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] aidan.heritage@virgin.net is offline
external usenet poster
 
Posts: 244
Default Opening the Autofilter dialog box

I think the problem is in the use of variables - you have specified
literal text, so the filter is happening on the TEXT - try something
like

dim StartDate as string, secondDate as string
StartDate="="& format(whateverdate,whateverformat)
Selection.AutoFilter Field:=1, Criteria1:=StartDate
etc



Pops Jackson wrote:
I have gotten frustrated with trying to get my code to work autofiltering
date ranges.
The code I am using includes:
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=firstdate",
Operator:=xlAnd, Criteria2:="<=seconddate"

The result is that the entire range is hidden.

How can I get the default autofilter dialog to show? I have decided this is
the best solution unless the code I am using can be altered successfully.

Thanks,

Jim
--
Pops Jackson