Without Dictionary:
Sub M_snb()
sn = Sheets("raw data").UsedRange
y = Application.Match("Serial", Sheets("raw data").Rows(1), 0)
For j = 1 To UBound(sn)
c00 = c00 & Replace(String(UBound(Split(sn(j, y), ",")) + 1, "|"), "|", "|" & j)
c01 = c01 & "," & sn(j, y)
Next
sp = Split(Mid(c00, 2), "|")
sp = Application.Index(sp, Evaluate("row(1:" & UBound(sp) + 1 & ")"))
sq = Split(Mid(c01, 2), ",")
sq = Application.Index(sq, Evaluate("row(1:" & UBound(sq) + 1 & ")"))
Sheets("desired result").Cells(1).Resize(UBound(sp), UBound(sn, 2)) = Application.Index(sn, sp, Evaluate("column(1:" & UBound(sn, 2) & ")"))
Sheets("desired result").Cells(1, y).Resize(UBound(sq)) = sq
End Sub
Bookmarks