I have the following table
ID. ID2. String
123. 567, 986 ABC;BCD;ACD
142. 134, 654,1134 AA;BB
I wa
Try this.
Sub FlattenData()
Dim rng As Range, arr() As Variant, i As Long, rw As Long, j As Long
Set rng = Range("A1:C2") //Update for your range
arr() = rng
rng.ClearContents
rw = 0
For i = 1 To UBound(arr, 1)
colBTemp = VBA.Split(arr(i, 2), ",")
colCTemp = VBA.Split(arr(i, 3), ";")
colBTempLength = UBound(colBTemp, 1) + 1
colCTempLength = UBound(colCTemp, 1) + 1
requiredRows = WorksheetFunction.Max(colBTempLength, colCTempLength)
For j = 1 To requiredRows
Range("A" & rw + j) = arr(i, 1)
If j <= colBTempLength Then
Range("B" & rw + j) = colBTemp(j - 1)
Else
Range("B" & rw + j) = vbNullString
End If
If j <= colCTempLength Then
Range("C" & rw + j) = colCTemp(j - 1)
Else
Range("C" & rw + j) = vbNullString
End If
Next j
rw = rw + requiredRows
Next i
End Sub