+ Reply to Thread
Results 1 to 7 of 7

Filter data by multiple criteria

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Filter data by multiple criteria

    Hello everyone
    I need to filter data by multiple criteria ..
    My data is in sheet1 and the field Auto ID is the target field
    My criteria is in sheet2 >> Range("A5:A" & Lastrow)

    I Can filter data with this code
    Please Login or Register  to view this content.
    Everything till now is ok
    I need to filter the range of criteria itself and to filter my data according to visble cells only
    In other words to store the variable Crit to assign only visible cells
    I tried to add .SpecialCells(xlCellTypeVisible but I have an error
    Thanks advanced
    Attached Files Attached Files
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Filter data by multiple criteria

    Hi Yasser,

    This works:

    Please Login or Register  to view this content.
    What would you like to do??
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Filter data by multiple criteria

    Mr. xladept
    Thanks for reply
    The code I posted in post 1 works fine ..I'm filtering data in sheet1 based on the criteria in sheet2 (stored as array)
    Now I need to store the criteria in sheet2 even if I filtered the criteria itself ..

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Filter data by multiple criteria

    Try
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Filter data by multiple criteria

    Mr. PCI
    Thank you very much for this great solution.
    I think it may be easier by using this :
    .SpecialCells(xlCellTypeVisible

    Generally it helped me a lot

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Filter data by multiple criteria

    Hi Yasser,

    PHP Code: 
    I think it may be easier by using this :
    .
    SpecialCells(xlCellTypeVisible 
    Can you explain what you mean ...?
    In the code sent it is used ..!
    The only issue is that you cannot turn visible cells to an array without reading cells one by one.
    PCI

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Filter data by multiple criteria

    The only issue is that you cannot turn visible cells to an array without reading cells one by one.
    Now I got it
    Thank you very much for your great help

+ 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 data and copy the data's from multiple columns based on the criteria
    By millatshawn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-22-2014, 08:14 AM
  2. Filter Data with a userform that has multiple criteria
    By TubbzUK in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-16-2014, 04:17 PM
  3. Filter Excel Data using vba multiple criteria multiple columns
    By pmyk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2013, 01:32 AM
  4. filter of data of one column through multiple criteria
    By sharmanjali87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-05-2011, 05:53 AM
  5. Excel 2007 : multiple criteria data filter
    By ballerino in forum Excel General
    Replies: 1
    Last Post: 07-10-2008, 04:49 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