[COLOR="Navy"]Sub[/COLOR] MG25Oct21
[COLOR="Navy"]Dim[/COLOR] AL [COLOR="Navy"]As[/COLOR] Object, Ac [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] K [COLOR="Navy"]As[/COLOR] Variant, Dn [COLOR="Navy"]As[/COLOR] Range, Rng [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Set[/COLOR] Rng = Range("A2", Range("A" & Rows.Count).End(xlUp))
ReDim Ray(1 To Rng.Count, 1 To 6)
[COLOR="Navy"]Set[/COLOR] AL = CreateObject("system.collections.arraylist")
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
[COLOR="Navy"]For[/COLOR] Ac = 0 To 5
AL.Add Dn.Offset(, Ac).Value
[COLOR="Navy"]Next[/COLOR] Ac
AL.Sort
[COLOR="Navy"]For[/COLOR] Ac = 0 To 5
Ray(Dn.Row - 1, Ac + 1) = AL(Ac)
[COLOR="Navy"]Next[/COLOR] Ac
AL.Clear
[COLOR="Navy"]Next[/COLOR] Dn
[COLOR="Navy"]Dim[/COLOR] nStr [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]String,[/COLOR] S [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] Txt [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]String,[/COLOR] n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] Rr [COLOR="Navy"]As[/COLOR] Variant, nRay [COLOR="Navy"]As[/COLOR] Variant
[COLOR="Navy"]Dim[/COLOR] R [COLOR="Navy"]As[/COLOR] Variant
[COLOR="Navy"]With[/COLOR] CreateObject("scripting.dictionary")
.CompareMode = vbTextCompare
[COLOR="Navy"]For[/COLOR] n = 1 To UBound(Ray)
nStr = "1,2,3,4,5,6"
[COLOR="Navy"]For[/COLOR] S = 5 To 11 [COLOR="Navy"]Step[/COLOR] 2
[COLOR="Navy"]For[/COLOR] Ac = 1 To 12 - S [COLOR="Navy"]Step[/COLOR] 2
Txt = Mid(nStr, Ac, S)
nRay = Split(Txt, ",")
R = Application.Index(Ray, n, nRay)
Txt = Join(R, ",")
[COLOR="Navy"]If[/COLOR] Not .Exists(Txt) [COLOR="Navy"]Then[/COLOR]
.Add Txt, 1
[COLOR="Navy"]Else[/COLOR]
.Item(Txt) = .Item(Txt) + 1
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR] Ac
[COLOR="Navy"]Next[/COLOR] S
[COLOR="Navy"]Next[/COLOR] n
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] K [COLOR="Navy"]In[/COLOR] .keys
[COLOR="Navy"]If[/COLOR] .Item(K) > 1 [COLOR="Navy"]Then[/COLOR]
c = c + 1: Cells(c, "H") = K: Cells(c, "I") = .Item(K)
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR] K
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]With[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]