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

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



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
Displaying AutoFilter criteria lehainam[_22_] Excel Programming 3 September 30th 05 10:51 PM
Why won't it work when I use VBA to set autofilter criteria to ce. biggy Excel Programming 3 May 25th 05 03:48 PM
Autofilter Multiple Criteria andibevan Excel Programming 1 September 29th 04 04:45 PM
AutoFilter Criteria VBA EstherJ Excel Programming 2 August 20th 04 12:54 PM
VBA Autofilter Criteria Brandon[_5_] Excel Programming 1 November 7th 03 12:40 PM


All times are GMT +1. The time now is 05:54 PM.

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

About Us

"It's about Microsoft Excel"