LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kev Kev is offline
external usenet poster
 
Posts: 46
Default Advanced Filter doesnt work in VB2007

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?
 
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
Why doesnt this work steve Excel Programming 1 March 3rd 08 12:52 PM
Why doesnt this work? [email protected] Excel Programming 4 February 10th 08 03:29 AM
Why doesnt my filter work!!!!! law Excel Discussion (Misc queries) 2 December 3rd 07 07:48 PM
Wildcards in Advanced filter criteria don't work with Excel 2003 Inconceivable Excel Programming 4 July 15th 05 02:49 AM
Advanced Filter does not work in this one Krish[_3_] Excel Programming 1 January 13th 04 10:10 PM


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