View Single Post
  #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?