Excel2007 - vba Advanced Filter Doesn't Calculate

AGilmour

New Member
Joined
Dec 28, 2009
Messages
1
Hi ,

vba Advanced Filter 2007 does not work whereas 1997..2003 does via a button click

I have previously used excel 97..2003 :) to calculate an advanced filter via vba, however I have now upgraded to 2007 :( and even after reviewing programming books the filter will not work in 2007 and doesn't pick up data, however the same macro in 2003 will work? I have found no data to confirm why this is as all the programming books say it is possible. Does anyone have any ideas. I am happy to email the code to anyone who can verify what the issue or who I can contact to sort the issue. I have spent the Xmas hols working on this to no avail. See below:

Sub Picture1_Click()
Dim rngData As Range
Dim rngCriteria As Range
Dim rngExtract As Range

'Define Database, Criteria & Extract Ranges

Set rngData = Workbooks("AFltr.xlsm").Worksheets_("Trial").Range("Database")
Set rngCriteria = ThisWorkbook.Worksheets("Trial").Range_("Criteria")
Set rngExtract = ThisWorkbook.Worksheets("Trial").Range_("Extract")

'Extract data with Advanced Filter
rngData.AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=rngCriteria, CopytoRange:=rngExtract, Unique:=False

End Sub


I would appreciate any ideas whatsoever. Much appreciated.

Trainee Excel Jedi
aka Andrew
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top