ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to use UserForm DTPicker.Value as Autofilter Crieteria (https://www.excelbanter.com/excel-programming/275692-how-use-userform-dtpicker-value-autofilter-crieteria.html)

Sulu[_2_]

How to use UserForm DTPicker.Value as Autofilter Crieteria
 
Hi all,

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

Thanks

Sulu



Tom Ogilvy

How to use UserForm DTPicker.Value as Autofilter Crieteria
 
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)

--
Regards,
Tom Ogilvy





Sulu wrote in message
...
Hi all,

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

Thanks

Sulu






All times are GMT +1. The time now is 03:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com