Extract Unique Values List
if you want to Extract Unique Value From a List , you can use this UDF :
Code:
Function UniqueList(rng As Range, Pos As Long) As String
Dim List() As String
Dim cell As Range
Dim i As Long
Dim t As Long
i = 0
ReDim List(rng.Cells.Count) As String
For Each cell In rng
flag = 0
For t = LBound(List) To UBound(List)
If cell.Value = List(t) Then
flag = 1
Exit For
End If
Next
If flag = 0 Then
List(i) = cell.Value
i = i + 1
End If
Next
UniqueList = List(Pos)
End Function
How would I get list of unique value
Hi Rajan,
How would I get list of Uniqe value though its return only single value.
Rajiv
Quote:
Originally Posted by
Rajan_Verma
if you want to Extract Unique Value From a List , you can use this UDF :
Code:
Function UniqueList(rng As Range, Pos As Long) As String
Dim List() As String
Dim cell As Range
Dim i As Long
Dim t As Long
i = 0
ReDim List(rng.Cells.Count) As String
For Each cell In rng
flag = 0
For t = LBound(List) To UBound(List)
If cell.Value = List(t) Then
flag = 1
Exit For
End If
Next
If flag = 0 Then
List(i) = cell.Value
i = i + 1
End If
Next
UniqueList = List(Pos)
End Function