+ Reply to Thread
Results 1 to 2 of 2

Count Unique Values in Column within VBA

Hybrid View

  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
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Count Unique Values in Column within VBA

    Try UDF as in the file attached.
    Attached Files Attached Files

+ 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