Results 1 to 10 of 17

Thread: Exclude Contents From List :

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    12
    Now using the UI facilities:

    Autofilter:
    Code:
    Sub M_snb_003()
        sn = Range("B1:B3")
    
        With Columns(1)
            .AutoFilter 1, sn(1, 1), xlOr, sn(2, 1)
            .SpecialCells(12).Delete xlShiftUp
            .AutoFilter
            .AutoFilter 1, sn(3, 1)
            .SpecialCells(12).Delete xlShiftUp
            .AutoFilter
        End With
    End Sub
    and advancedfilter

    Code:
    Sub M_snb_004()
        Cells(1, 4).Resize(, 3) = Cells(1, 1).Value
        Cells(2, 4).Resize(, 3) = Array("<>" & Cells(1, 2), "<>" & Cells(2, 2), "<>" & Cells(3, 2))
        Columns(1).AdvancedFilter 2, Cells(1, 4).CurrentRegion, Cells(1, 12)
    End Sub
    The criterion range can be filled manually (or only once); after that you can test the speed of avancedfilter.
    For simplicity's sake I added the code to fill the criterion range.
    Last edited by snb; 06-07-2013 at 03:49 PM.

Similar Threads

  1. Replies: 5
    Last Post: 01-12-2013, 02:49 AM
  2. Delete List Contain Matching from Second List
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 12
    Last Post: 10-07-2012, 07:18 PM
  3. Macro for Opening files and copy the contents of the File
    By ravichandavar in forum Excel Help
    Replies: 16
    Last Post: 08-15-2012, 09:17 PM
  4. Macro to create files as per the contents in a column
    By Praveen Bj in forum Excel Help
    Replies: 1
    Last Post: 07-05-2012, 09:07 PM
  5. Replies: 4
    Last Post: 05-14-2012, 11:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •