Hi,

I have been stuck with this problem for quite some time now and with the solutions I have found and adapted I have had no luck.

Intention:

"- In an AutoFilter select all values EXCEPT 58 of values (text) which I define

1st attempt:

- Have the macro create a new column and assign a number 0 to all rows I define and 1 to all values not in my list

Sub ExcludeSet()

    Columns("E:E").Select
    Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
    Range("E1").Select
    ActiveCell.FormulaR1C1 = "Include1"
    Range("E2").Select
    ActiveCell.FormulaR1C1 = _
        "=IF(RC[-2]=""abc"",0,IF(RC[-2]=""bcd"",0,IF(RC[-2]=""cde"",0,IF(RC[-2]=""def"",0,1))))"
    Range("E2").Select
    Selection.AutoFill Destination:=Range("E2:E6")
    Range("E2:E6").Select
    
    ActiveSheet.Range("$A$1:$E$6").AutoFilter Field:=5, Criteria1:="1", _
    Operator:=xlFilterValues
End Sub
2nd attempt:

- Adapt the macro formula to include all 58 values:

Sub ExcludeSet()

    Columns("E:E").Select
    Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
    Range("E1").Select
    ActiveCell.FormulaR1C1 = "Include1"
    Range("E2").Select
    ActiveCell.FormulaR1C1 = _
        "="
IF(RC[-1]=""AACCUS"",0,IF(RC[-1]=""CSACL"",0,IF(RC[-1]=""EUROSE"",0,IF(RC[-1]=""NONCCP"",0,IF(RC[-1]=""QSTATE"",0,IF(RC[-1]=""XGARB"",0,IF(RC[-1]=""BBHUS"",0,IF(RC[-1]=""DE12NL"",0,IF(RC[-1]=""EUX"",0,IF(RC[-1]=""NORDIC"",0,IF(RC[-1]=""QUIRIN"",0,IF(RC[-1]=""XGFIUS"",0,IF(RC[-1]=""BNPBME"",0,IF(RC[-1]=""DE14NL"",0,IF(RC[-1]=""EUXISE"",0,IF(RC[-1]=""OPTPRF"",0,IF(RC[-1]=""SPCONV"",0,IF(RC[-1]=""XMACQ"",0,IF(RC[-1]=""CBF"",0,IF(RC[-1]=""DEP2NL"",0,IF(RC[-1]=""FCC"",0,IF(RC[-1]=""QBOOS"",0,IF(RC[-1]=""SPDADR"",0,IF(RC[-1]=""XMAG"",0,IF(RC[-1]=""CBF000"",0,IF(RC[-1]=""DEP5NL"",0,IF(RC[-1]=""HCH"",0,IF(RC[-1]=""QCUR"",0,IF(RC[-1]=""SPDB"",0,IF(RC[-1]=""XPRBN"",0,IF(RC[-1]=""CBF001"",0,IF(RC[-1]=""DEP6NL"",0,IF(RC[-1]=""IMCPRF"",0,IF(RC[-1]=""QMORG"",0,IF(RC[-1]=""SPJPM"",0,IF(RC[-1]=""XSEB"",0,IF(RC[-1]=""CBFFES"",0,IF(RC[-1]=""DTCC"",0,IF(RC[-1]=""LCHLSE"",0,IF(RC[-1]=""QREPBO"",0,IF(RC[-1]=""TYMEIS"",0,IF(RC[-1]=""XSPD"",0,IF(RC[-1]=""CBI"",0,IF(RC[-1]=""DTCCUS"",0,IF(RC[-1]=""LCHLTD"",0,IF(RC[-1]=""QSOCGE"",0,
IF(RC[-1]=""VRTPRF"",0,IF(RC[-1]=""CCGCLR"",0,IF(RC[-1]=""EMCF"",0,IF(RC[-1]=""LEKSEC"",0,IF(RC[-1]=""QSOURC"",0,IF(RC[-1]=""XAOO82"",0,IF(RC[-1]=""CIBC"",0,IF(RC[-1]=""QSTABO"",0,IF(RC[-1]=""XBMOLO"",0,IF(RC[-1]=""CSACE"",0,IF(RC[-1]=""XCITI"",0,IF(RC[-1]=""XCNTR"",0,1))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
    Range("E2").Select
    Selection.AutoFill Destination:=Range("E2:E6")
    Range("E2:E6").Select
    
    ActiveSheet.Range("$A$1:$E$6").AutoFilter Field:=5, Criteria1:="1", _
    Operator:=xlFilterValues
End Sub
When i try to paste in the values something goes wrong and I cannot get it to delete these quotation marks:

 ActiveCell.FormulaR1C1 = _
        "="
IF(RC[-1]=""A....
Where what I want it to do is:


 ActiveCell.FormulaR1C1 = _
        "=IF(RC[-1]=""A....
Any help would be very much appreciated and would save me a lot of frustration.