sort from date, to date in list

A

Axel

Am trying to sort a list that contains a big amount of dates, with help
of two textboxes on a userform.
This don't work, but it shows the correct values in the custom dialog
from the dropdown box

Private Sub CommandButton1_Click()
Sheet1.Select
Dim FirstDate As Date
Dim LastDate As Date
FirstDate = TextBox1.Text
LastDate = TextBox2.Text

Selection.AutoFilter Field:=3, Criteria1:=">" & Format(FirstDate,
"mm/dd/yyyy"), _
Operator:=xlAnd _
, Criteria2:="<" & Format(LastDate, "mm/dd/yyyy")
Unload UserForm1

Grateful for any help

*** Sent via Developersdex http://www.developersdex.com ***
 

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

Top