+ Reply to Thread
Results 1 to 3 of 3

VBA Error: Runtime Error 1004: AutoFilter method of Range class failed

  1. #1
    Registered User
    Join Date
    10-03-2013
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    6

    VBA Error: Runtime Error 1004: AutoFilter method of Range class failed

    Hello,

    I'm new to VBA programming, and I'm hoping that someone can help me to pinpoint the root cause of an error message I'm getting. The error message is:

    Runtime Error 1004: AutoFilter method of Range class failed

    I'm trying to duplicate the code of another programmer on a different worksheet. I've pasted the code below and highlighted in red the line of code that is resulting in the error. I've also included the Function code in case there is something I'm missing there.

    Please Login or Register  to view this content.
    Any help anyone can provide is greatly appreciated! I apologize that I may not have pasted the code in a visually-friendly format. This is my first time posting a thread, so hopefully I've provided all the necessary details.

    Thanks!
    Jen
    Last edited by alansidman; 10-03-2013 at 04:36 PM. Reason: code tags added

  2. #2
    Administrator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 365 Version 2211 (Build 15813.20002) Win 11 Home 64 Bit
    Posts
    22,079

    Re: VBA Error: Runtime Error 1004: AutoFilter method of Range class failed

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (I have added the code tags for you this time. Please adhere to our rules in the future.)
    Alan


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-03-2013
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: VBA Error: Runtime Error 1004: AutoFilter method of Range class failed

    Thank you Alan. I appreciate your help - I'm new to writing posts and I obviously didn't pay enough attention to the rules. I actually just figured out my problem.

    I had the following line of code:
    Please Login or Register  to view this content.
    The column header in the worksheet is "REGION" (all CAPS). In my IF statement in the FindColumnHeadings Function,
    Please Login or Register  to view this content.
    was calculating to FALSE because "Region" and "REGION" are not equal in VBA. I changed the line of code to
    Please Login or Register  to view this content.
    , and I'm no longer getting the error!

    Thanks,
    Jen

+ 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. Runtime error 1004: Insert method of Range class failed......not sure why
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-21-2011, 02:15 PM
  2. runtime error 1004 pastespecial method of range class failed
    By JillCALIBRE in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-30-2009, 11:31 AM
  3. Error: Runtime 1004 - Select method of range class failed
    By additude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2008, 05:58 PM
  4. runtime error 1004 pastespecial method of range class failed
    By dreamz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-03-2006, 10:57 AM
  5. [SOLVED] Runtime Error 1004 Select method of Range class Failed
    By IanO in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2005, 04: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