View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Kevin Kevin is offline
external usenet poster
 
Posts: 504
Default Custom filter date using VB

Hi

I am running a macro to select rows from data using filter of certain
fields. It works fine for the fields where I have to searching for specific
text eg

Selection.AutoFilter Field:=10, Criteria1:="=*" & strReportSponsor & "*"

however I am trying to filter a date field to say where the date is less
then a particular date

Selection.AutoFilter Field:=13, Criteria1:="<=" & ReportDueBy

the macro enters the less than date in the filter but it does not select any
rows. When I select the filter manually I can see the date has been entered
by the macro and then when I manually select "ok" again it works fine. Any
idea why the macro is not returning any rows?

--
Kevin