+ Reply to Thread
Results 1 to 5 of 5

Autofilter method of class failed

  1. #1
    Forum Contributor
    Join Date
    03-09-2007
    Location
    Australia
    MS-Off Ver
    Office 10
    Posts
    371

    Autofilter method of class failed

    Hi
    I have a worksheet which I use to find accounts paid
    It is rather basic but does the job.
    I am getting a run time error 1004 every time I press the search button
    Can I ask for assistance please regarding the code
    I have attached an example which highlights the problem

    Assistance appreciated and suggestions of what I have done wrong here because I am keen to learn more about excel
    Attached Files Attached Files

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Autofilter method of class failed

    in the code you are looping 2 to 12, not sure why, but it errors when you try filtering a column that is beyond the columns being filtered. so i = 6 raises the error as column F is not part of the autofilter.

    Please Login or Register  to view this content.
    If you are matching marchant name then you should filter column 4. If Name is in different places on different sheets then perhaps you should add code to locate it first and then filter the correct column
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    03-09-2007
    Location
    Australia
    MS-Off Ver
    Office 10
    Posts
    371

    Re: Autofilter method of class failed

    Am I able to ask you to correct the code for me so it works without the error

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Autofilter method of class failed

    Assuming you only need to autofilter the name field on a sheet and that field is in the same column on all sheets, try

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-09-2007
    Location
    Australia
    MS-Off Ver
    Office 10
    Posts
    371

    Re: Autofilter method of class failed

    Many thanks for the assistance

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Autofilter method of Range Class Failed
    By slamdunka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-09-2015, 03:24 AM
  2. AutoFilter Method Of Range Class Failed
    By goss in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-10-2015, 09:40 PM
  3. Autofilter Method of Range Class Failed
    By flindy87 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-02-2013, 11:51 AM
  4. AutoFilter method of Range class failed - Yet autofilter works.
    By Carlsbergen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2009, 05:43 PM
  5. Autofilter method of range class failed
    By Terry K in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-17-2005, 11:05 PM

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