Advanced Filter problem

  • Thread starter Thread starter SB
  • Start date Start date
S

SB

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top