Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Help with using filter criteria with date


This one has me puzzled...

In previous macros I've used this code if I wanted the criteria value
to = a value in a cell somewhere else.

Sheets("Data 1").Select
Selection.AutoFilter Field:=7, Criteria1:=Sheets("Report").Range("A1"),
Operator:=xlAnd

In this case for example, cell A1 in Report worksheet has a value of
"test". So in the Data 1 worksheet, it would find all rows with "test"
in Column G (pretty simple).

I seem to be having difficulty using the same method above when
instead of using a word like "test", I'm using a date, like 12/11/05 in
my Report worksheet, cell A1. There are plenty of dates with 12/11/05
in the Data 1 sheet so I'm puzzled.

I've double checked the format of the cell in A1 to make sure it's the
same format as the dates in Column G in Data 1 and everthing is in
synch.

Any ideas?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Help with using filter criteria with date

Try

Sheets("Data 1").AutoFilter Field:=7,
Criteria1:=Sheets("Report").Range("A1").Text, Operator:=xlAnd


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

wrote in message
ps.com...

This one has me puzzled...

In previous macros I've used this code if I wanted the criteria value
to = a value in a cell somewhere else.

Sheets("Data 1").Select
Selection.AutoFilter Field:=7, Criteria1:=Sheets("Report").Range("A1"),
Operator:=xlAnd

In this case for example, cell A1 in Report worksheet has a value of
"test". So in the Data 1 worksheet, it would find all rows with "test"
in Column G (pretty simple).

I seem to be having difficulty using the same method above when
instead of using a word like "test", I'm using a date, like 12/11/05 in
my Report worksheet, cell A1. There are plenty of dates with 12/11/05
in the Data 1 sheet so I'm puzzled.

I've double checked the format of the cell in A1 to make sure it's the
same format as the dates in Column G in Data 1 and everthing is in
synch.

Any ideas?



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
formula to find the filter criteria [email protected] Excel Worksheet Functions 12 December 30th 05 07:04 PM
count records which meet filter criteria AKH Excel Discussion (Misc queries) 1 October 31st 05 03:54 PM
How can I DISPLAY Filter Criteria Scott Fendrich Excel Worksheet Functions 2 June 10th 05 08:15 PM
How do I filter a list using a greater than todays date function? LV Excel Worksheet Functions 2 April 29th 05 06:07 PM
Need to filter more than one date HT New Users to Excel 3 April 24th 05 08:38 PM


All times are GMT +1. The time now is 01:04 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"