I assume your data starts at A1 and you have a header row, if not create a header row.
Try running this:
Sub SplitRows()
Dim a, b, i As Long, j As Long
With Range("A1").CurrentRegion
a = .Value
.Offset(1).Value = ""
For i = 2 To UBound(a, 1)
If InStr(a(i, 2), ",") > 0 Then
b = Split(a(i, 2), ",")
For j = 0 To UBound(b)
Range("A" & rows.Count).End(xlUp).Offset(1).Resize(, 2).Value = Array(a(i, 1), Trim(b(j)))
Next
Else
Range("A" & rows.Count).End(xlUp).Offset(1).Resize(, 2).Value = Array(a(i, 1), a(i, 2))
End If
Next
End With
End Sub
Bookmarks