Good afternoon,
I am having a big issue in my quest to learn VBA. Currently, my data is (as below) in a structure that sometimes contains multiple serial numbers belonging to a single part.
I have a VBA macro that I wrote which imports this data and formats it appropriately for a separate program. However, I am working on a sub that will allow me to go through and separate these serial numbers that are delimited by a comma.
But, I want it to look like this:
I found some code on this site (Split Cells Into Multiple Rows using Vb Code) which has helped, but I am having trouble with it: Here is what I have
Sub SplitSerial()
Dim SN As String
Dim i As Integer
Dim numArray()
SN = ActiveCell.Value
numArray = Split(SN, " ")
For LBound(numArray) To UBound(numArray)
Cells(1, i + 1).Value = numArray(i)
MsgBox numArray(i)
Next i
End Sub
The problem is, this spreadsheet can get pretty large (5,000+) rows, so I don't know how to have it loop through the column, and if it has a ",', split the serial numbers but copy the values from the remaining cells.
Any guidance, advice, or coaching would be greatly appreciated. I am trying very hard to learn VBA.