+ Reply to Thread
Results 1 to 5 of 5

auto filter criteria count

  1. #1
    Registered User
    Join Date
    05-22-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    4

    auto filter criteria count

    Hello Masters,

    have a quick question. I wish to count the individual criteria in the autofilter. I'd appreciate for your generous help.

    here is a example

    A B C

    apple red big
    apple green small
    orange yellow big
    pears purple mediumn


    I wish to konw how many unique items in each column. So the answer should be 3, 4, 3

    Thanks in advanced.
    Last edited by crazyqq; 05-30-2011 at 10:39 AM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: auto filter criteria count

    Hi Crazuqq and welcome to the forum,

    Find the attached with some "helping" columns and the answer I think you desire.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    05-22-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: auto filter criteria count

    Brilliant! Thanks MVP...

    Now I need to think a way to code it in vba without showing the helping "columns".
    Last edited by crazyqq; 05-24-2011 at 10:26 PM.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: auto filter criteria count

    Hi,

    I saw an example a few months ago where a guy used a Collection Object. The idea is that he kept adding strings to the collection but if it was already there it wouldn't add a new object. Then he knew the unique number of objects by counting how many were in the collection.

    Perhaps you can use this kind of code. I'm sure it was on this site but can't find it now.

  5. #5
    Registered User
    Join Date
    05-22-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: auto filter criteria count

    Thanks!

    Finally, I found an easier way to do it, just want to share

    select the range, and choose tools-> filter-> Advanced Filter -> Unique records only

    then excel will paste the list into a new column with unique record.

+ 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