Sub justtest() Dim dic, i&, j%, k% Set dic = CreateObject("scripting.dictionary") Range("m:x").ClearContents For i = 1 To Cells(Rows.Count, 1).End(3).Row For j = 1 To 10 If Not dic.exists(j) Then dic.Add j, "" Next j For k = 1 To 8 If dic.exists(Cells(i, k).Value) Then dic.Remove Cells(i, k).Value Next k Cells(i, 13).Resize(1, dic.Count) = dic.keys Cells(i, 24) = dic.Count Next i Set dic = Nothing End Sub
Sub justtest() Dim dic, i&, j%, k% Set dic = CreateObject("scripting.dictionary") Range("m:x").ClearContents For i = 1 To Cells(Rows.Count, 1).End(3).Row For j = 1 To 10 If Not dic.exists(j) Then dic.Add j, "" Next j For k = 1 To 8 If dic.exists(Cells(i, k).Value) Then dic.Remove Cells(i, k).Value Next k Cells(i, 13).Resize(1, dic.Count) = dic.keys Cells(i, 24) = dic.Count Next i Set dic = Nothing End Sub