Filer dates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top