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.
Bookmarks