or ?
Code:Sub ConcatDashedRanges() Columns(1).replace "=","'=" For Each Ar In Columns(1).SpecialCells(2).Areas Ar(1).Offset(, 1) = Application.Trim(Join(filter(filter(Application.Transpose(Ar.Value),"--",false),"'=",false), ";")) Next End Sub
or ?
Code:Sub ConcatDashedRanges() Columns(1).replace "=","'=" For Each Ar In Columns(1).SpecialCells(2).Areas Ar(1).Offset(, 1) = Application.Trim(Join(filter(filter(Application.Transpose(Ar.Value),"--",false),"'=",false), ";")) Next End Sub
That's correct; they have been filtered out.
You can remove the filter that does that: filter(...,"'=","")
I know I am a few years late with this, but here is a function that with take a delimited text string (which is the output from my ConCat function) and returns the same delimited text with duplicate removed. So, to accomplish what you want, simply pass the output from the ConCat function into the first argument for the Uniques function below and specify the delimiter in the second argument... the output from the Uniques function will be what you asked for.
Code:Function Uniques(Text As String, Delimiter As String) As String Dim X As Long, Data() As String Data = Split(Text, Delimiter) With CreateObject("Scripting.Dictionary") For X = 0 To UBound(Data) .Item(Data(X)) = 1 Next Uniques = Join(.Keys, Delimiter) End With End Function
Bookmarks