+ Reply to Thread
Results 1 to 3 of 3

Dynamic filter criteria

  1. #1
    Registered User
    Join Date
    09-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Dynamic filter criteria

    Hi,

    I have a autofilter and it will filter the data in columnB depends on the state users choose. The user can pick state via multi optionbuttoms (NJ, PA, etc.) Each state will refer to the specific number (NJ=2, PA=3, etc). What I try to do is filte the data under columnB that contain 2 (if I pick NJ in this case). here is my code:

    Please Login or Register  to view this content.
    This code has some porblme when I add the Criteria 2. Could someone help?

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Dynamic filter criteria

    Your criteria 2 has 'a' as part of the string.

    Try

    Criteria2:="=*" & a & "*"
    Martin

  3. #3
    Registered User
    Join Date
    09-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Dynamic filter criteria

    Hi Martin, It works!!!!! thanks!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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