+ Reply to Thread
Results 1 to 2 of 2

Advanced Filter problem

  1. #1
    SB
    Guest

    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

  2. #2

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


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1