Results 1 to 6 of 6

select unique values range to column

Threaded View

  1. #1
    Registered User
    Join Date
    07-11-2016
    Location
    Netherlands
    MS-Off Ver
    2010
    Posts
    2

    select unique values range to column

    Sub SelectUniqueValues()

    'I want to select the unique values from range("A4:F70")
    'and show them from K4, sorted aswell.
    'the script works fine, but only for the first column, not for the wanted range,
    'I tries several changes, but they don't work.
    'What does I have to change?


    Dim X
    Dim objDict As Object
    Dim lngRow As Long
    
    Set objDict = CreateObject("Scripting.Dictionary")
    X = Application.Transpose(Range([a1], Cells(Rows.Count, "A").End(xlUp)))
    
    For lngRow = 1 To UBound(X, 1)
        objDict(X(lngRow)) = 1
    Next
    Range("K4:K" & objDict.Count) = Application.Transpose(objDict.keys)
    End Sub
    Attached Files Attached Files
    Last edited by rhvanloenen; 07-11-2016 at 07:19 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 08-19-2015, 10:22 AM
  2. Count Unique Values within range when other column is not blank
    By samn827 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-29-2015, 09:50 AM
  3. [SOLVED] Count unique text values within a range based on another column
    By Sebastes in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-14-2014, 01:38 PM
  4. Count Unique Values In One Column Basis Unique Values in Another Column
    By shez_raz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-07-2012, 01:55 AM
  5. Replies: 3
    Last Post: 09-20-2011, 05:05 PM
  6. Select Unique values ....
    By shahcu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-31-2008, 05:11 AM
  7. [SOLVED] How to select a range based on values in 1 column
    By ForestRamsey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-30-2005, 12:05 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