+ Reply to Thread
Results 1 to 2 of 2

Autofilter Array Criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    08-03-2014
    Location
    Philippines
    MS-Off Ver
    Microsoft Office 2010
    Posts
    43

    Autofilter Array Criteria

    Can anyone know what is the problem in my code?
    Here's the result when I run my program;

    Capture.PNG
    12.PNG


    Private Sub CommandButton1_Click()
    
    Dim ws1 As Worksheet
    
    
        Application.Workbooks("WU_P1 FOR MACRO.xlsb").Activate
        Set ws1 = Sheets("Sheet1")
      
    
        With ws1
        .AutoFilterMode = False
        .Range("I1:I" & .Range("I" & Rows.Count).End(xlUp).Row).AutoFilter Field:=1, Criteria1:=Array("#N/A", "0000000", "6XXXXXX", "DUMMY", "DUMMY BUILD", "N/A", "NA", "STAMSDUMMY", "TBA", "TBD", ""), Operator:=xlFilterValues
        .AutoFilter.Range.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Cut
        .AutoFilterMode = False
        End With
        
        Application.Sheets("Sheet3").Select
        Range("A2").Select
    
        Selection.Insert Shift:=xlDown
        Application.ScreenUpdating = True
        
    End Sub

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Autofilter Array Criteria

    cut method would not work with filtered cells, you need to use delete instead.

+ 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. Using an array as criteria in an AutoFilter
    By brucemc777 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2014, 10:15 AM
  2. [SOLVED] AutoFilter: Array as Criteria
    By Klaster in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-10-2014, 06:36 PM
  3. [SOLVED] Using an array from a range for Autofilter Criteria
    By J-Tin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2013, 10:49 AM
  4. AutoFilter Multiple Criteria Array
    By erock24 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-02-2013, 04:33 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