Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Autofilter Question

Good day,

I have a workbook with a sheet named 'Download'
On this sheet i want to filter column C
When i record what i want to happen i get the following code :
Sheets("Download").Select
Selection.AutoFilter Field:=3, Criteria1:="=1-1-2003", Operator:=xlAnd,
Criteria2:="<31-1-2003"
But when i run it, i get nothing selected.
What goes wrong??

Tia Mark


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Autofilter Question

Selection.AutoFilter Field:=3, Criteria1:="=1-1-2003", Operator:=xlAnd,
range("yourrange").AutoFilter Field:=3, Criteria1:="=1-1-2003",

Operator:=xlAnd,

"geen" wrote in message news:1064433326.443335@cache2...
Good day,

I have a workbook with a sheet named 'Download'
On this sheet i want to filter column C
When i record what i want to happen i get the following code :
Sheets("Download").Select
Selection.AutoFilter Field:=3, Criteria1:="=1-1-2003", Operator:=xlAnd,
Criteria2:="<31-1-2003"
But when i run it, i get nothing selected.
What goes wrong??

Tia Mark




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Autofilter Question

I believe your problem is that you are using d-m-yyyy format and vba works
with the US format

Sheets("Download").Select
Selection.AutoFilter Field:=3, Criteria1:="=" & cDate("1-1-2003"), _
Operator:=xlAnd, Criteria2:="<" & cDate("31-1-2003")

should work.

--
Regards,
Tom Ogilvy




"geen" wrote in message news:1064433326.443335@cache2...
Good day,

I have a workbook with a sheet named 'Download'
On this sheet i want to filter column C
When i record what i want to happen i get the following code :
Sheets("Download").Select
Selection.AutoFilter Field:=3, Criteria1:="=1-1-2003", Operator:=xlAnd,
Criteria2:="<31-1-2003"
But when i run it, i get nothing selected.
What goes wrong??

Tia Mark




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
Autofilter Question kate Excel Discussion (Misc queries) 0 April 25th 08 07:13 PM
Autofilter Question veryeavy Excel Discussion (Misc queries) 0 April 24th 08 02:00 AM
AutoFilter Question AccessHelp Excel Discussion (Misc queries) 2 September 29th 06 09:25 PM
Autofilter Question k9nny Excel Discussion (Misc queries) 1 February 28th 06 07:52 PM
Question about Autofilter... Richard Latter New Users to Excel 3 February 28th 05 04:41 PM


All times are GMT +1. The time now is 09:06 AM.

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"