+ Reply to Thread
Results 1 to 4 of 4

Autofilter criteria non blanks and not zero

  1. #1
    Registered User
    Join Date
    12-13-2011
    Location
    Breda, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    9

    Autofilter criteria non blanks and not zero

    Hello,

    I have a column containing empty cells, cells with value zero and a variable number of variable values. I want to make a filter which only shows the values that are not zero or not blanks.

    This is part of a larger VBA macro, but the specific selection looks like following:

    ActiveSheet.ListObjects(Range("M1").Value).Range.AutoFilter Field:=9, Criteria1 _
    :="<>0", Operator:=xlOr, Criteria2:=


    I cannot find the way to define the second criteria. In Access I would state NotNull but that doesn't seem to work in Excell. Can anyone help me out?
    Thank You.
    Last edited by sjors.hoevenaars; 01-14-2012 at 05:24 AM.

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Autofilter criteria non blanks and not zero

    Your post does not comply with forum rule #3. You must enclose any code within code tags.

    this code will filter the range to show only non zero (criteria1) cells and non blank (criteria2) cells.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-13-2011
    Location
    Breda, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Autofilter criteria non blanks and not zero

    I will try this code, at least the blank criteria should help me out. I used listobjects because the data is in a table object in my sheet. If I select the whole column, it contains also data which should not be involved in the autofilter

  4. #4
    Registered User
    Join Date
    12-13-2011
    Location
    Breda, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Autofilter criteria non blanks and not zero

    Thanks p24leclerc! Problem Solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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