+ Reply to Thread
Results 1 to 10 of 10

Get unique values sorted

Hybrid View

  1. #1
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Get unique values sorted

    Correction....
    Code should be
    Function UniqNonBlank(rng As Range, sortCol As Long, ref As Long, col As Long)
        Dim a, i As Long, ii As Long, w, txt As String
        a = rng.Value: ReDim w(1 To UBound(a, 2))
        With CreateObject("System.Collections.SortedList")
            For i = 1 To UBound(a, 1)
                txt = Format$(a(i, sortCol), String(20, "0"))
                For ii = 1 To UBound(a, 2)
                    w(ii) = a(i, ii): txt = txt & Chr(2) & a(i, ii)
                Next
                If Len(Replace(txt, Chr(2), "")) Then
                    If Not .Contains(txt) Then .Item(txt) = w
                End If
                txt = ""
            Next
            UniqNonBlank = .GetByIndex(ref - 1)(col)
        End With
    End Function
    Last edited by jindon; 01-01-2015 at 08:27 AM. Reason: Re edit

+ 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. [SOLVED] Summerize unique values from multiple columns / Sorted alphabetically
    By Lacaycer in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-01-2014, 02:40 PM
  2. [SOLVED] Extract Unique Values from Long list and Put in Sorted Order
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-08-2013, 09:10 PM
  3. [SOLVED] Unique distinct alphabetically sorted list
    By atlant15 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-06-2013, 10:03 AM
  4. Sorted List of all Unique strings
    By ElmerS in forum Excel General
    Replies: 2
    Last Post: 04-30-2009, 02:40 PM
  5. Indexing Down Sorted Column to Next Unique Number
    By longfisher in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-02-2007, 07:45 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