+ Reply to Thread
Results 1 to 2 of 2

Code for AutoFilter Items

Hybrid View

  1. #1
    Forum Contributor mubashir aziz's Avatar
    Join Date
    03-18-2009
    Location
    Lahore, Pakistan
    MS-Off Ver
    MS Office 2013
    Posts
    533

    Code for AutoFilter Items

    Hi,

    I am facing a problem that I am preparing a sheet which is controlling a document control record, there are different types like "in Progress", "Waiting Response" and delays like 3 Day(s) Delay, 5 Day(s) Delay, etc.

    Firstly I applied this code and it worked nicely

    ActiveSheet.Range("$A$3:$W$526").AutoFilter Field:=17, Criteria1:=Array( _
    "17 Day(s) Delay", "5 Day(s) Delay", "In Progress", "Waiting Response"), Operator _
    :=xlFilterValues


    But there are lot of documents which are 17, 20, 1 , 4. 10 days delays so i used below code, which worked nicely too

    ActiveSheet.Range("$A$3:$W$526").AutoFilter Field:=17, Criteria1:=Array( _
    "*Delay*", "Waiting Response"), Operator:=xlFilterValues

    But as soon as i enter another items "In Progress", it filter only the items of "Waiting Response" and "In Progress". it skip "**Delay*" values by not selecting them.

    ActiveSheet.Range("$A$3:$W$526").AutoFilter Field:=17, Criteria1:=Array( _
    "*Delay*", "Waiting Response", "In Progress"), Operator:=xlFilterValues


    Can someone help me that what's wrong with this code?



    Even if i use some other items like "IFC, "IFI", it still works but wild character with delay is not working. I have used "=*delay*", "*delay*" and every time its working but as soon as i select 3rd items it stops working.

    I have posted this problem on other forum too but no response so If i'll get any response, I'll post here.

    Sample column


    Status
    Waiting Response
    17 Day(s) Delay
    5 Day(s) Delay
    5 Day(s) Delay
    5 Day(s) Delay
    In Progress
    Waiting Response
    Waiting Response
    Waiting Response
    Waiting Response
    Waiting Response
    If this post helps, Please don't 4get to click the star icon located at the bottom left of my Post.

  2. #2
    Forum Contributor mubashir aziz's Avatar
    Join Date
    03-18-2009
    Location
    Lahore, Pakistan
    MS-Off Ver
    MS Office 2013
    Posts
    533

    Re: Code for AutoFilter Items

    Sorry Guys I think my post should move to VBA / MACRO section.

+ 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. macro to filter all items in Autofilter except 2+ items
    By DanRiverBrew in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-09-2013, 09:15 PM
  2. Autofilter related items
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-23-2011, 09:43 AM
  3. Selecting more than two items in an AutoFilter
    By tangcla in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-19-2008, 01:05 AM
  4. [SOLVED] AutoFilter and unique items
    By b&s in forum Excel General
    Replies: 4
    Last Post: 07-23-2006, 04:50 PM
  5. Extracting items from Autofilter drop down
    By Golgo 13 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-19-2005, 04:05 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