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:
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
y = y + 1
Loop Until y = x
Application.CutCopyMode = False
- Running the code will let you input the number of times you want to see the row repeated.
- In your case select the row with 100pcs in it, run the code, input 10 and you will see that your one row turned into 10 rows.
Thanks to Trowa
for this tip.