+ Reply to Thread
Results 1 to 10 of 10

Find and list only unique results in a column

  1. #1
    Registered User
    Join Date
    07-02-2008
    Location
    Winnipeg, MB
    Posts
    57

    Find and list only unique results in a column

    Lets say I have text in the range A1:A60000. In this range I will have some text that is the same (Example A1 = cat and A4 = cat). What I want to do is find and list all values in column A, but do not list duplicates.

    Is this possible?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You could use Advanced Filter, and exclude duplicates.

  3. #3
    Registered User
    Join Date
    07-02-2008
    Location
    Winnipeg, MB
    Posts
    57
    Yes, but Iit won't do. I need it to be effectively automated with a formula or macro.

  4. #4
    Registered User
    Join Date
    07-09-2008
    Location
    Melbourne
    Posts
    33
    Try this

    Please Login or Register  to view this content.
    Last edited by VBA Noob; 07-10-2008 at 03:59 PM.

  5. #5
    Registered User
    Join Date
    07-02-2008
    Location
    Winnipeg, MB
    Posts
    57
    Quote Originally Posted by flex
    Try this

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("A:A")) Then
    Range("a1").Select
    Range(Selection, Selection.End(xlDown)).AdvancedFilter Action:=xlFilterInPlace, Unique:=True
    End If
    End Sub
    Tried it and it's not working. I get the error "runtime error '91': Object varible or With block variable not set"

  6. #6
    Registered User
    Join Date
    07-09-2008
    Location
    Melbourne
    Posts
    33
    Please Login or Register  to view this content.
    Last edited by VBA Noob; 07-10-2008 at 04:00 PM.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    flex,

    Please read our forum rules. You must apply code tags to codes so that they are more readable.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  8. #8
    Registered User
    Join Date
    07-02-2008
    Location
    Winnipeg, MB
    Posts
    57
    Quote Originally Posted by flex
    Sub Worksheet_Change(ByVal Target As Range)

    If Target.Column = 1 Then

    Range("a1").Select
    ActiveSheet.Range("$A$1:$A$13").RemoveDuplicates Columns:=1, Header:=xlNo
    End If

    End Sub
    iI've inputted the code and nothing happens...

  9. #9
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Vbort:

    An advanced filter macro will do the trick, but it's important to know HOW you want the event to launch (ie, when do you want the filter to apply), and where you want the results to go (where to list the non-dups).

    With more information, it will be easier to give you workable answers.

  10. #10
    Registered User
    Join Date
    07-02-2008
    Location
    Winnipeg, MB
    Posts
    57
    Okay. I would like to launch the event by clicking a button that has the macro associated with it and I would like the results to go on a new worksheet.

    Please let me know if you have any other questions.

+ 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