Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unique numbers in array
Hi I have an array that contains about 200 numbers and I need to check so the array onley contains unique numbers. If it contains double I want to remove them. How do I do that in an easy way? Thanks in advance *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unique numbers in array
Hi,
How do I do that in an easy way? Can we see the code that creates this array? Mike "Kalle" wrote: Hi I have an array that contains about 200 numbers and I need to check so the array onley contains unique numbers. If it contains double I want to remove them. How do I do that in an easy way? Thanks in advance *** Sent via Developersdex http://www.developersdex.com *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unique numbers in array
It come from a datebase question arr = split(rs.fields(0), ",") *** Sent via Developersdex http://www.developersdex.com *** |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unique numbers in array
Hi
One quick and dirty way: Sub test() MsgBox Uniques("1,2,3,3,3,4,5,4,3,56,12,56", ",") End Sub Function Uniques(strData As String, _ strDelimiter As String) As String Dim C As Collection Dim AR() As String Dim i As Long AR = Split(strData, strDelimiter) Uniques = "" Set C = New Collection On Error Resume Next For i = LBound(AR) To UBound(AR) C.Add AR(i), AR(i) Next For i = 1 To C.Count Uniques = Uniques & C(i) & "," Next Uniques = Left$(Uniques, Len(Uniques) - 1) Set C = Nothing End Function HTH. Best wishes Harald "Kalle" wrote in message ... It come from a datebase question arr = split(rs.fields(0), ",") *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Count equal numbers as unique numbers | Excel Discussion (Misc queries) | |||
unique values in an array | Excel Programming | |||
unique values to array | Excel Programming | |||
how to extract unique numbers once from a list of repeated numbers? | Excel Discussion (Misc queries) | |||
Non-unique elements in an array | Excel Discussion (Misc queries) |