Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why doesnt this work | Excel Programming | |||
Why doesnt this work? | Excel Programming | |||
Why doesnt my filter work!!!!! | Excel Discussion (Misc queries) | |||
Wildcards in Advanced filter criteria don't work with Excel 2003 | Excel Programming | |||
Advanced Filter does not work in this one | Excel Programming |