ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Advanced Filter problem (https://www.excelbanter.com/excel-programming/324205-advanced-filter-problem.html)

SB

Advanced Filter problem
 
Folks,

I have an excel file which is used as a database of contact
information. There are several macro buttons which the user can use
to show the whole list or to filter the list. The VBA code uses the
AdvancedFilter command...

Range("sysFilterList").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Range("sysCriteria"), Unique:=False

The file operates correctly on many machines in the office, most of
whom are running Windows 2000 & Excel 2000.

A colleague who runs Windows XP and Excel 2003 cannot use the file as
the procedure hangs at this line of code. On escaping out of the code
I get the error message "AdvancedFilter method of range class failed".

Can anyone out there guess why this file isn't working on my
colleague's machine?

Thanks in advance

Stuart

[email protected]

Advanced Filter problem
 
Hi
I occasionally got this if I didn't activate the sheet where the
AdvancedFilter was taking place. So you might try putting in something
like
Range("sysFilterList").Parent.Activate

before the filter (or YourSheet.Activate if it is a fixed sheet).

I don't know if a filter being in place already might cause a problem.
If it does you can remove it with

With Range("sysFilterList").Parent
On Error Resume Next 'required if Advanced filter used
.ShowAllData
On Error GoTo 0
.AutoFilterMode = False 'Removes drop down arrows
End With

before you filter

regards
Paul



All times are GMT +1. The time now is 01:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com