View Single Post
I see you...
NAPse's Avatar
380
Legg til:

Kode

Function RemoveDupes(txt As String, Optional delim As String) As String
    Dim x
    With CreateObject("Scripting.Dictionary")
        .CompareMode = vbTextCompare
        For Each x In Split(txt, delim)
            If Trim(x) <> "" And Not .exists(Trim(x)) Then .Add Trim(x), Nothing
        Next
        If .Count > 0 Then RemoveDupes = Join(.keys, delim)
    End With
End Function
Ny formel:

Kode

=RemoveDupes(IF(B2=1, JoinText(C2:INDIRECT("C"&MATCH(A2,A:A,1)),"|"), ""),"|")
Oops, her er en bedre formel som ikke kaller på RemoveDupes() uansett utfall

Kode

=IF(B2=1, RemoveDupes(JoinText(C2:INDIRECT("C"&MATCH(A2,A:A,1)),"|"), "|"),"")
Sist endret av NAPse; 28. mars 2017 kl. 12:47. Grunn: Automatisk sammenslåing med etterfølgende innlegg.