View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default AutoFilter criteria

Hi Mark,

Try changing:

Criteria1:="=" & StartDate & "",


to

Criteria1:="=" & CLng(StartDate)

---
Regards,
Norman



"Mark" wrote in message
...
I am using Excel 97.

I have a worksheet of data with read-only access which has a column with a
formatted column of dd-mmm-yy (by another department!). I am trying to
filter it with VBA.

I have done the following but failing to get the required information
returned!

dim StartDate as date

Selection.AutoFilter
Selection.AutoFilter Field:=2, Criteria1:="=" & StartDate & "",
Operator:= _
xlAnd

Can someone offer me a workaround, please?

--
Mark