Results 1 to 5 of 5

Excel 2007 : Macro run-time error 1004

Threaded View

tuph Macro run-time error 1004 11-18-2009, 07:12 PM
shg Re: Macro run-time error 1004 11-18-2009, 07:21 PM
tuph Re: Macro run-time error 1004 11-18-2009, 11:34 PM
scaffdog845 Re: Macro run-time error 1004 11-20-2009, 02:31 PM
tuph Re: Macro run-time error 1004 11-23-2009, 07:04 PM
  1. #1
    Valued Forum Contributor
    Join Date
    02-09-2006
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 2016
    Posts
    1,077

    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:
    Sub SMS()
    '
    ' SMS Macro
    ' list of SMS messages to non-Company phones
    '
    
    '
        ActiveSheet.Range("$A$4:$L$6311").AutoFilter Field:=3, Criteria1:="=*sms*" _
            , Operator:=xlAnd
        ActiveSheet.Range("$A$4:$L$6311").AutoFilter Field:=7, Criteria1:= _
            "<>*phone # 1*", Operator:=xlOr, Criteria2:="<>*phone # 2*", ..... Criteria34:="<>*phone # 34*"
    End Sub
    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

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