Reputation: 3
I've got an Excel file with over 10k rows, which looks like
I need to expand numbers in DATA2 field using delimeter ";" to a new rows:
Is it possible to do it with Excel?
Upvotes: 0
Views: 77
Reputation: 294
You can do it with VBA. Open the Macros in MS Excel and insert this code.
Sub todo()
lRow = Cells(Rows.Count, 1).End(xlUp).Row
rowNum = lRow
For r = 1 To lRow
symbolCounter = UBound(Split(Cells(r, 3).value, ";")) + 1
textVal = Split(Cells(r, 3).value, ";")
For c = 1 To symbolCounter
rowNum = rowNum + 1
Cells(rowNum, 1).value = Cells(r, 1).value
Cells(rowNum, 2).value = Cells(r, 2).value
Cells(rowNum, 3).value = textVal(c - 1)
Next c
Next r
End Sub
Should work.I checked.
Upvotes: 1