How to use UserForm DTPicker.Value as Autofilter Crieteria

  • Thread starter Thread starter Sulu
  • Start date Start date
S

Sulu

Hi all,

How Can I use DTPicker1.Value and DTPicket2.Value as my
Autofilter crieria1 and Crieteri2?

Thanks

Sulu
 
Sub SetFilter()
With Userform1
Worksheets("Sheet1").Range("A1").AutoFilter _
Field:=1, _
Criteria1:=">=" & .DtPicker1.Value, _
Operator:=xlAnd, _
Criteria2:="<=" & .DtPicker2.Value
End With
End Sub


you might have to do

clng(.DtPicker1.Value)

clng(.DtPicker2.Value)
 
Back
Top