Results 1 to 3 of 3

Include Blank Cells in Autofilter that uses an Array as Criteria

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-14-2007
    Location
    Chester, England
    MS-Off Ver
    2010 & 2016
    Posts
    312

    Include Blank Cells in Autofilter that uses an Array as Criteria

    Hello

    I hope someone can help. It feels like it should be really straighforward but its driving me mad.

    I have an autofilter that is working fine using an array but I want to include "(Blanks)" and this is where I am having trouble. I have tried listing it as Criteria2, I have tried adding it to the array, I have tried having a blank cell in the range I use to create the array but nothing seems to work.

    This is what I have so far.

    Dim DealArray As Variant
    
    DealArray = Sheets("Sheet1").Range("A2:A15").Value
    
    On Error Resume Next
    ActiveSheet.ShowAllData
    ActiveSheet.AutoFilterMode = False
    On Error GoTo 0
    
    DealArray = Application.Transpose(DealArray)
    
    ActiveSheet.Range("$A$1:$AZ$936").AutoFilter Field:=1, Criteria1:=DealArray, Operator:=xlFilterValues

    Does anyone know what I can add to or change about the above code to include blanks?

    Thanks in advance for any help

    Cheers

    Jim
    Last edited by JimmyA; 08-04-2017 at 10:00 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Autofilter 3+ criteria using VBA or an array
    By kaemerso in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2017, 12:01 PM
  2. Countif Criteria incl non-blank cells within an array formula.
    By Miskondukt in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-31-2016, 05:24 PM
  3. [SOLVED] AutoFilter: Array as Criteria
    By Klaster in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-10-2014, 06:36 PM
  4. Replies: 1
    Last Post: 12-27-2013, 03:56 PM
  5. AutoFilter for multiple criteria and blank cells
    By crunchKH in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2013, 02:01 AM
  6. [SOLVED] Autofilter with multiple criteria - how to ignore blank criteria
    By MOONDRIFT47 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-31-2012, 12:20 PM
  7. [SOLVED] Need to Autofilter by date and include blank cells
    By Jigsaw314 in forum Excel General
    Replies: 2
    Last Post: 11-05-2012, 08:01 PM

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