PC Review


Reply
Thread Tools Rate Thread

Advanced Filter doesnt work in VB2007

 
 
Kev
Guest
Posts: n/a
 
      2nd Jun 2008
So I create a macro which performs an advanced filter on a range of data,
during the recording (or any time I perform the advanced filter manually) it
works perfectly.

However when I run the Macro it doesn't work. No errors, it just doesnt
copy any data over to the new location, or even if I set the macro to filter
in place, it just removes all data.

Its basically giving a result that suggests that there were no records that
matched the criteria, despite it working fine when done manually.

This is only in Excel 2007 as the exact same work book worked fine in Excel
2003.

I have done some testing and eventually discovered that it is being affected
by Date criteria. If I am filtering with just a text or number criteria then
its all fine. It also doesnt matter whether its an actual date or a date
formula (e.g. >=01/01/08).

Below is my macro

Columns("A:F").Select
Columns("A:F").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=Sheets( _
"sht_filters").Range("C3:G4"), CopyToRange:=Range("G1:L1"),
Unique:=False


So does anyone know why the dates would be affecting it (they are in UK
format if that matters?), and why it would only be an issue when run in VB
rather than a manual filter in XL?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why doesnt my filter work!!!!! law Microsoft Excel Misc 2 3rd Dec 2007 07:48 PM
DirectorySearcher.Filter doesnt seem to work TheVillageCodingIdiot Microsoft Dot NET Framework 1 25th Sep 2006 11:17 PM
Outlook 2002 SP3 - Advanced Find Doesnt Work? Paul Moloney Microsoft Outlook Discussion 0 4th Apr 2005 03:44 PM
Filter doesnt work. =?Utf-8?B?Sm9odWxh?= Microsoft Excel Crashes 0 26th Jan 2005 10:17 AM
Outlook: filter in view doesnt work!!!! help! dmitry Microsoft Outlook VBA Programming 0 4th Aug 2003 09:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:22 AM.