+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Macro run-time error 1004

  1. #1
    Valued Forum Contributor
    Join Date
    02-09-2006
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 2016
    Posts
    1,075

    Macro run-time error 1004

    I am trying to create a macro to filter a very lengthy list of phone usage. I have successfully created the macro by recording the filter on column C (which returns only SMS message charges) and filtering by two phone numbers from column G. I then edited the macro to add the extra phone numbers I need to report on (34 phone numbers in total).

    I have attached a small sample of my workbook and here's a snippet of my code:
    Please Login or Register  to view this content.
    When I run the macro, the filter on column C works okay but the filter on column G (highlighted in red) gives me run-time error 1004.

    I can't find any info about this error code but I suspect it is related to the number of phone numbers I am trying to include in the filter. Could this be the case?

    I would appreciate it if someone could point me in the right direction please.
    Attached Files Attached Files
    Trish in Oz
    -------------
    A problem well defined is a puzzle half solved


    If you attach a sample of your workbook it will be easier to find a solution. Remember to remove/replace sensitive data before uploading the file. Look here if you need help with attachments:
    http://www.excelforum.com/faq.php?fa...b3_attachments

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro run-time error 1004

    You can only have two criteria for a given column in AutoFilter. Look in the user interface.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Valued Forum Contributor
    Join Date
    02-09-2006
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 2016
    Posts
    1,075

    Re: Macro run-time error 1004

    Thanks SHG. I'll work something else out.

  4. #4
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    375

    Re: Macro run-time error 1004

    Tuph,

    I often struggle with macros myself but this may work for you... Make sure to change the ranges $A$1:$L$22 to accommodate your full range of numbers.

    Please Login or Register  to view this content.
    Hope it helps.

  5. #5
    Valued Forum Contributor
    Join Date
    02-09-2006
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 2016
    Posts
    1,075

    Re: Macro run-time error 1004

    Thanks for your suggestion Scaffdog. I won't have the time to try it for a few days, but I do appreciate you input. I'll get back to you if I have any further questions.

+ 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