I would like to split a row of data into several rows of same data in MS Excel. For example, I have an item with standard packing size of 100pcs per box. My customer places an order for 1,000pcs. I would like to have this order item repeated 10 times in the worksheet with each row having 100pcs as the box quantity.
First select the entire row you would like to repeat.
Run the following code:
Sub RepeatRow() Dim iRow As Integer Dim x As Integer Dim y As Integer iRow = ActiveCell.Row x = InputBox("Number of times you want to display the selected row:") y = 1 Do Rows(iRow).Copy Selection.Insert Shift:=xlDown y = y + 1 Loop Until y = x Application.CutCopyMode = False End Sub
Thanks to Trowa for this tip.