Hello, I need a Macro to copy every 6th row (starting at 1) and insert underneath said row. It would look something like this: 1 Black 2 Blue 3 Gold 4 Green 5 Orange 6 Red 7 Black 8 Blue 9 Gold 10 Green 11 Orange 12 Red Needs to be: 1 Black 1 Black 2 Blue 3 Gold 4 Green 5 Orange 6 Red 7 Black 7 Black 8 Blue 9 Gold 10 Green 11 Orange 12 Red And repeat this for the entire sheet. If someone can explain what the number variables do in their code I would be able to alter it for my different uses. Sometimes I will need it to duplicate the 6th row, sometimes the 4th, etc. I have this code that does somethign similar. I can copy every row 'x' number of times. It may be able to be altered to do what I need. It has been so long since I used excel that I have forgotten what each variable does:(
Sub insertrows() MyColumn = "A" For x = Cells(Rows.Count, MyColumn).End(xlUp).Row To 1 Step -1 Rows(x).Copy Rows(x).Resize(6).Insert Next x End Sub
This question generated 12 answers. To proceed to the answers, click here.
This thread is current as of November 22, 2015.