+ Reply to Thread
Results 1 to 6 of 6

Auto Filter Exclude items

  1. #1
    Registered User
    Join Date
    04-02-2014
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Auto Filter Exclude items

    Hi,

    I have this code and i'm getting an error is there a way to achieve this?

    ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=3, Criteria1:= _
    Array("<>313586885", "<>313586877", "<>313586844", "<>313586752", _
    "<>313400772", "<>313400855", "<>313400749", "<>313400731", "<>313400673", _
    "<>313400657"), Operator:=xlFilterValues

    There are 1000 different items in Field 3.

    Thanks

  2. #2
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Auto Filter Exclude items

    Try using AdvancedFilter instead...

    Please Login or Register  to view this content.
    To maintain the table's formatting, try replacing...

    Please Login or Register  to view this content.
    with

    Please Login or Register  to view this content.
    Hope this helps!
    Last edited by Domenic; 07-03-2014 at 10:14 AM. Reason: Corrected a typo in the code...

  3. #3
    Registered User
    Join Date
    04-02-2014
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Auto Filter Exclude items

    Hi Domenic,

    Maybe i'm suppose to change some other parts to your code but all it is doing it copy and pasting it to another page...

    to Clarify. I have these headers, which are located on sheet "Step1"
    Sector Portfolio Cusip Amount OFV

    I have code currently that filters the sector column how I want.
    Then i need the cusip column filtered to remove those sets of cusips i provided above.

    Then I have a loop that open 10 workbooks

    as part of the loop i want to add that each wookbook opened applies a different filter to the portfolio column and then copys column cusip, amount and ofv to sheet "Step2" as paste values. then a few more steps and then ultimatly copy over to the workbook that was opened and saved. then Next loop.





    Set CopyToRng = Worksheets("Info2").Range("A1") 'change the destination range accordingly

    With ActiveSheet.ListObjects("Table1").Range
    LastCol = .Columns.Count + .Columns(1).Column - 1
    With .Parent
    .Cells(2, LastCol + 2).FormulaR1C1 = "=ISNA(MATCH(RC" & .Columns(3).Column & ",{313586885,313586877," & _
    "313586844,313586752,313400772,313400855,313400749,313400731,313400673,313400657},0))"
    Set CritRng = .Cells(1, LastCol + 2).Resize(2)
    End With
    .AdvancedFilter Action:=xlFilterInPlace, criteriarange:=CritRng, copyToRange:=", unique:=False"
    .Copy CopyToRng
    .Parent.ShowAllData
    End With

  4. #4
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Auto Filter Exclude items

    In future, can you please use code tags when posting code. It makes it easier to read. In any case, I see that some how a line of code got messed up when I posted it. It should be...

    Please Login or Register  to view this content.
    Does this help?

  5. #5
    Registered User
    Join Date
    04-02-2014
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Auto Filter Exclude items

    Page.png
    this is the basic screen i'm trying to filter. Two filters at first. applied to column 1 and 3 and then a third filter applied in a loop to column 2

    Please Login or Register  to view this content.
    I'm getting an error at .Parent.ShowAllData

  6. #6
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Auto Filter Exclude items

    Can you please be specific? What error message and number are you getting?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] how to exclude a criteria using auto filter
    By kadasanis in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-21-2013, 02:12 PM
  2. exclude items from autosum
    By dru.darby in forum Excel General
    Replies: 3
    Last Post: 12-31-2008, 03:33 PM
  3. How do I count visible items in an auto filter?
    By n2lectual in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-19-2008, 08:15 PM
  4. Exclude Chart Items
    By blatham in forum Excel General
    Replies: 0
    Last Post: 08-03-2006, 10:40 AM
  5. Counting items in auto filter - how?
    By country birder in forum Excel General
    Replies: 4
    Last Post: 03-28-2006, 03:25 PM

Tags for this Thread

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