I am testing this function to find unique values of a column and display them in a cell separated by commas. With the following function it does what I want, but when there are blanks at the beginning or at the end, it returns duplicate values caused by these blanks.
This is the function:
Function ConcatUniq(xRg As Range, xChar As String) As String
'updateby Extendoffice
Dim xCell As Range
Dim xDic As Object
Set xDic = CreateObject("Scripting.Dictionary")
For Each xCell In xRg
xDic(xCell.Value) = Empty
Next
ConcatUniq = Join$(xDic.Keys, xChar)
Set xDic = Nothing
End Function
Thank you very much!