Sub chuoichuoi()
Dim arr As Variant, kq(), i As Long, d As Object, chuoi, chuoi2 As String
arr = [c3:c5].Value
Set d = CreateObject("scripting.dictionary")
For i = 1 To UBound(arr)
For j = i To UBound(arr)
If i = j And Not IsEmpty(arr(i, 1)) Then chuoi = arr(i, 1)
If j > i And Not IsEmpty(arr(i, 1)) And Not IsEmpty(arr(j, 1)) Then chuoi = chuoi & arr(j, 1)
If Not d.exists(chuoi) Then
k = k + 1
d.Add chuoi, ""
ReDim Preserve kq(1 To k)
kq(k) = chuoi
End If
If j > i And Not IsEmpty(arr(i, 1)) And Not IsEmpty(arr(j, 1)) Then chuoi2 = arr(i, 1) & arr(j, 1)
If Not d.exists(chuoi2) Then
k = k + 1
d.Add chuoi2, ""
ReDim Preserve kq(1 To k)
kq(k) = chuoi2
End If
Next
Next i
[b22].Resize(, k).Value = kq
Set d = Nothing
End Sub