+ Reply to Thread
Results 1 to 2 of 2

Autofilter Method Query - Criteria1: <> Not Equal

  1. #1
    Registered User
    Join Date
    04-16-2009
    Location
    Kilkenny, Ireland.
    MS-Off Ver
    Excel 365
    Posts
    47

    Autofilter Method Query - Criteria1: <> Not Equal

    Hi,

    This is probably a case of my not knowing the correct syntax (I do not have any programming background) but I have a problem as follows.

    I have a table which I need to filter twice:

    in the first instance, filtering by each row where the selected field (=2) is equal to any of a group of named strings (IncludedFamily1 etc),

    and in the second instance, filtering by each row where the selected field (=4) value is not equal to any of a group of named strings(ExcludedComponent1 etc)

    Here are the 2 statements:

    Please Login or Register  to view this content.
    The first statement works fine.

    The second statement does not, returning either an error message during code exec or else not filtering the table as intended, depending on the use and/or placement of the various "not equal to", "<>", "NOT" variations of code that I have tried to date.

    I hope this makes sense. Any pointers towards incorporating the required "<>" requirement into the second statement would be greatly appreciated.

    Thanx
    Orson.
    Last edited by Orson100; 06-09-2009 at 05:56 PM.

  2. #2
    Registered User
    Join Date
    01-19-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Office 2007
    Posts
    1

    Re: Autofilter Method Query - Criteria1: <> Not Equal

    In my experience the <> operator is not compatible with the xlFilterValues operator.

    You will have to use the xlAnd Operator to accomplish this.

    ActiveSheet.ListObjects("MasterPriceList").Range.Autofilter(2, "<>" & ExcludedComponent1,xlAnd, "<>" & ExcludedComponent2)

+ 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