+ Reply to Thread
Results 1 to 2 of 2

Thread: Count Unique Values in Column within VBA

  1. #1
    Registered User
    Join Date
    07-21-2009
    Location
    Kansas City, KS
    MS-Off Ver
    Excel 2003
    Posts
    1

    Count Unique Values in Column within VBA

    Hi All,

    I'd like to load a variable within VBA with the result of a Unique values count in a given column in Excel. For example:

    Column 1
    36"
    42"
    36"
    48"
    48"
    42"

    I've added a button which does some things, and part of what I want it to do on click, is to go down column 1 and:

    Set mycount = CountUnique (myrange)

    The mycount value would then become "3" in this instance.

    Everything I've been able to find thus far requires a cell formula entry, however I'd like mine to be entirely in VBA code.

    Hope this makes sense.

    Thanks for any help you can offer.

    - J

  2. #2
    Valued Forum Contributor
    Join Date
    12-14-2009
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    986

    Re: Count Unique Values in Column within VBA

    Try UDF as in the file attached.
    Attached Files Attached Files
    To thank someone who has helped you, click on the star icon below their name.

    I hate reading

    Portfolio

    I need a job.
    I am young and incompetent

+ 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.2.0