#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 104
Default Filer dates

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

  #2   Report Post  
Posted to microsoft.public.excel.misc
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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 104
Default Filer dates

Hi Ron

The cells in the worksheet are in the following format "yyyy.mm.dd"

"Ron de Bruin" wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Identifying unique dates in a row of cells containing dates... cdavidson Excel Discussion (Misc queries) 9 October 13th 06 08:43 PM
Identifying unique dates in a range of cells containing dates... cdavidson Excel Discussion (Misc queries) 4 October 13th 06 03:30 PM
Dates showing are not what I type Mick New Users to Excel 5 July 6th 06 04:19 AM
need to convert list of dates to count no. of dates by week neowok Excel Worksheet Functions 13 January 30th 06 03:54 PM
Calculating number of days between two dates that fall between two other dates [email protected] Excel Discussion (Misc queries) 5 October 26th 05 06:18 PM


All times are GMT +1. The time now is 07:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"