Results 1 to 6 of 6

Deleting rows using Autofilter with multiple <> criteria

Threaded View

  1. #1
    Registered User
    Join Date
    10-14-2013
    Location
    Saturn
    MS-Off Ver
    Excel 2010
    Posts
    28

    Deleting rows using Autofilter with multiple <> criteria

    Sub test()
    Dim c As Long
    
    With ActiveSheet
        c = .Rows(1).Find("Status").Column
        .AutoFilterMode = False
        .Columns(c).AutoFilter Criteria1:=Array("<>RET", "<>LTD"), Operator:=xlFilterValues
        .AutoFilter.Range.Offset(1, 0).EntireRowDelete
        .AutoFilterMode = False
    End With
    
    End Sub
    This code is meant to find the column headed by "Status", then delete all rows with Status NOT EQUAL to "RET" and "LTD."
    I'm getting Run-time error '1004': AutoFilter Method of Range class failed on
        .Columns(c).AutoFilter Criteria1:=Array("<>RET", "<>LTD"), Operator:=xlFilterValues
    Appreciate any help.
    Last edited by {=OR(value=array)}; 04-15-2014 at 04:27 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Deleting rows, multiple column criteria
    By Lift Off in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-24-2014, 09:40 PM
  2. [SOLVED] Deleting rows based on multiple criteria
    By weldo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-02-2012, 08:02 AM
  3. Deleting rows, Multiple criteria
    By Wedge120 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2011, 10:51 PM
  4. Deleting Multiple Criteria Rows / Data manipulation
    By SystemsAccountant in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-19-2008, 10:33 AM
  5. Deleting blanks rows based on multiple criteria
    By Pedros in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2006, 12:44 AM

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