+ Reply to Thread
Results 1 to 4 of 4

Advanced Filtering

  1. #1
    Registered User
    Join Date
    07-08-2005
    Posts
    11

    Advanced Filtering

    I have a data which I would like to filter, I decided to go for Advanced Filter.

    A simple example, in the given sheet I have data in 6 columns and I would like to have the filter as
    Channel = 1 or 2
    Mode = diff
    Temp = 25 or 85
    Reference = 6 or 7
    Vdd = 2.25

    (Please note that I can have many conditions here and hence Autofilter can not be used) If I have to have an autofilter for this it should look like the yellow box on the "FilterConditions" Sheet.

    My questions is how do I write a VBA program to do this, I would want to find all combinations and put them in proper order by choosing 1 from each column at a time.

    I am also not sure how many conditions would be available (I can decide the max though, let say 10 if someone needs it)

    Any help would be highly appreciated.

    Thanks
    Mohit
    Attached Files Attached Files

  2. #2
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    You can use the auto filter for this. with auto filter on, run the following code:

    Please Login or Register  to view this content.
    Last edited by Portuga; 03-14-2008 at 01:49 AM.
    If you found the solution to your question. Mark the thread as "Solved"
    Thank everyone that helped you with a valid solution by clicking on their

    There is no such thing as a problem, only a temporary lack of a solution

  3. #3
    Registered User
    Join Date
    07-08-2005
    Posts
    11
    Thanks for your help but I am not sure how many columns I would have, it could be 1 or it could be 6.

    Some columns can be empty too (in my program I can avoid to put those kind of columns if required).

    The unknown number of colums is what is giving me the main problem. Also I need a way to write this as a code.

    Thanks
    Mohit

  4. #4
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    The VBA code I wrote above can be applied to an auto filter, but you should know the number of columns there are or at least where the filtering criteria columns are positioned...

+ 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