+ Reply to Thread
Results 1 to 12 of 12

Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-21-2014
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    232

    Re: Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    @thiefofthings - thanks for this - I suspected that the formula path may be tricky so thanks for confirming what Google results had me fearing.

    If I want to run this on column C, as opposed to A, just need to alter the column references to A in the VBA yes?

  2. #2
    Registered User
    Join Date
    04-19-2017
    Location
    Manchester, England
    MS-Off Ver
    Excel 2013, Office 365, Windows 10
    Posts
    14

    Re: Find unique values in column - in a SINGLE CELL FORMULA; can it be done please?

    Quote Originally Posted by iantix View Post
    @thiefofthings - thanks for this - I suspected that the formula path may be tricky so thanks for confirming what Google results had me fearing.

    If I want to run this on column C, as opposed to A, just need to alter the column references to A in the VBA yes?
    Yep, just change from A to C, and you end up with this:

    Sub UniqueValues()
    
    With Application
        .ScreenUpdating = False     'turns off screen updating
    End With
    
    
    Dim x As Long
    
    x = ActiveSheet.Range("C1048576").End(xlUp).Row     'find last non-blank row in column C
    
    With ActiveSheet.Range("C2:C" & x)                          'copy entries from C2 to the last non-blank row
        .Copy
    End With
    
    With ActiveSheet.Range("M1")                        'paste copied entries to empty column
        .PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    End With
    
    With ActiveSheet.Range("M:M")                       'removes duplicate email addresses
        .RemoveDuplicates Columns:=1, Header:=xlNo
    End With
    
    With ActiveSheet.Range("D2")                        'counts non-blank entries in column M
        .Formula = "=COUNTA(M:M)"
        .Value = .Value
    End With
    
    With ActiveSheet.Range("M:M")                       'tidies up
        .ClearContents
    End With
    
    
    With Application
        .ScreenUpdating = True
    End With
    
    End Sub

+ 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] Unique values to a single column -- formula constraints
    By macrorookie in forum Excel General
    Replies: 1
    Last Post: 09-01-2016, 02:40 AM
  2. Replies: 2
    Last Post: 06-16-2016, 08:09 PM
  3. Replies: 6
    Last Post: 05-26-2016, 11:12 PM
  4. [SOLVED] Detect unique values in cell and find them in column to count them
    By Ivancitomusic in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-02-2015, 02:37 PM
  5. Replies: 9
    Last Post: 10-14-2013, 07:55 PM
  6. Fetch Unique values from a single column
    By Sherlyn Rachel in forum Excel General
    Replies: 3
    Last Post: 03-23-2011, 08:05 AM
  7. Transpose unique values in one column/mult. rows into a single row
    By Wil in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-22-2005, 04:06 AM

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