This code was written by Mike. Infact, Jindon too provided one, so you had two codes working. I have re-run Mike's code and could not see any error, except the first 3 lines which I suspect were added by you, are not working. You also do not say(Show) which lines are the missing rows.
I have commented the first 3 lines
Sub Step3()
'Set r = Range("C5:C200")
'Set rr = r.SpecialCells(xlCellTypeBlanks)
'rr.EntireRow.Delete
Dim aNum, b
Dim i As Long, ii As Long
With ActiveWorkbook.ActiveSheet
With .Range("a5:n" & Cells(Rows.Count, "c").End(xlUp).Row)
aNum = .Value
.Clear
End With
With CreateObject("Scripting.Dictionary")
.CompareMode = 1
For indx = LBound(aNum) To UBound(aNum)
If Not .exists(aNum(indx, 3)) Then
ReDim b(1 To UBound(aNum, 2))
For ii = LBound(aNum, 2) To UBound(aNum, 2)
b(ii) = aNum(indx, ii)
Next
.Item(aNum(indx, 3)) = Join(b, ",")
Else
ReDim b(1 To 7)
For ii = 1 To 7
b(ii) = aNum(indx, ii + 7)
Next
.Item(aNum(indx, 3)) = .Item(aNum(indx, 3)) & "," & Join(b, ",")
End If
Next
aNum = .Items
End With
Application.ScreenUpdating = False
For i = LBound(aNum) To UBound(aNum)
x = Split(aNum(i), ",")
For ii = LBound(x) To UBound(x)
.Cells(i + 5, ii + 1) = x(ii)
Next
Next
'.Columns("N:N").EntireColumn.Insert
Application.ScreenUpdating = True
End With
End Sub
Bookmarks