Filter criteria (Series_Name) is not recognized

Dear Experts,

I am trying to create a macro that will sort all the functions in the "Functional Area" column of a table called InitiativeTbl. All the functions should be selected except for the Series_Name (which is defined as cell C8 from the "Cover" sheet).
I have the following macro but it doesn't recognize the Series_Name criteria.

Sub Macro3()
'
' Macro1 Macro
'
Dim Series_Name As String

    Series_Name = Range("Cover!$C$8").Value

    With Sheets("Initiative Summary").ListObjects("InitiativeTbl")
        .Range.AutoFilter field:=.ListColumns("Functional Area").Index, Criteria1:="<>Series_Name", Operator:=xlFilterValues
   
    End With
   
End Sub

Once I change the criteria to an actual function from the column, the macro works.
Could you please help me figure this out.

Thank you.
jmac001Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Rob HensonConnect With a Mentor Finance AnalystCommented:
Try changing to:

Criteria1:="<>"&Series_Name

Thanks
Rob H
0
All Courses

From novice to tech pro — start learning today.