Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default removing duplicates in lists

Hi,

If say I have 3 lists of data (1 in column A, 1 in B and 1 in C), is there a
way that I can get Column D to produce a list of all the unique values from
A,B,C.

IE:

Col A Col B Col C....... Therefore Col D =
a t z a
b q w b
c a a c
t
q
z
w

TIA.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default removing duplicates in lists

I very good solution for this. Good reading

http://j-walk.com/ss/excel/tips/tip15.htm

somethinglikeant

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default removing duplicates in lists

Sub GetUniqueList()
Dim noDupes As New Collection
Dim v(1 To 3) As Variant
Dim v1 As Variant, itm as Variant
Dim i As Long, j As Long
With Worksheets("Sheet1")
v(1) = .Range(.Cells(1, 1), .Cells(1, 1).End(xlDown)).Value
v(2) = .Range(.Cells(1, 2), .Cells(1, 2).End(xlDown)).Value
v(3) = .Range(.Cells(1, 3), .Cells(1, 3).End(xlDown)).Value
End With
On Error Resume Next
For i = 1 To 3
For j = LBound(v(i)) To UBound(v(i))
noDupes.Add v(i)(j, 1), CStr(v(i)(j, 1))
Next
Next
Debug.Print noDupes.Count
On Error GoTo 0
ReDim v1(1 To noDupes.Count, 1 To 1)
i = 0
For Each itm In noDupes
i = i + 1
v1(i, 1) = itm
Next
Range("D1").Resize(noDupes.Count, 1).Value = v1

End Sub


--
Regards,
Tom Ogilvy



"red6000" wrote in message
...
Hi,

If say I have 3 lists of data (1 in column A, 1 in B and 1 in C), is there

a
way that I can get Column D to produce a list of all the unique values

from
A,B,C.

IE:

Col A Col B Col C....... Therefore Col D =
a t z a
b q w b
c a a c
t
q
z
w

TIA.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Duplicates Help Scott Excel Discussion (Misc queries) 6 May 5th 09 03:58 AM
Removing Duplicates sat Excel Discussion (Misc queries) 5 June 18th 05 11:18 PM
Removing Duplicates sat Excel Worksheet Functions 1 June 18th 05 11:18 PM
Removing Duplicates sat Excel Programming 2 June 17th 05 10:15 PM
removing duplicates marina madeleine Excel Programming 0 September 15th 04 06:39 PM


All times are GMT +1. The time now is 09:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"