Thread: Filer dates
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Filer dates

In which format are the dates in the worksheet cells ?

You can also use EasyFilter to filter on Dates
Maybe you like it
http://www.rondebruin.nl/easyfilter.htm



"Steen" wrote in message ...
Hi

When I use the below code for the autofilter conditions - txtStartDate and
txtEndDate dosn't work. The dates are in the custom filter if I look after
running the code and if I reactivate it after this everything i ok. Any help?

txtStartDate and txtEndDate are input via text fields in a userform.

Private Sub cmdOK_Click()

if (Err)
...
Else
Selection.AutoFilter Field:=3, Criteria1:="=" & txtStartDate.Value,
Operator:=xlAnd, Criteria2:="<=" & txtEndDate.Value
End If
...
End Sub