PDA

View Full Version : Solved: How do I copy and insert rows



twelvety
03-09-2009, 06:53 AM
Hi,

I have a spreadsheet with over 200 rows. I now need to copy each row and insert it as a new row beneath the original. For example the first value in the first 3 rows are;

3
8
5

After making the changes there would be double the amount of rows with the first value in the first 6 rows being;

3
3
8
8
5
5

Is anyone able to supply some VBA code to do this automatically as manually this takes a long time.

Thanks in advance

Bob Phillips
03-09-2009, 07:00 AM
Untested



Dim i As Long
Dim LastRow As Long

With ActiveSheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = LastRow To 1 Step -1

.Rows(i).Copy
.Rows(i + 1).Insert
Next i
End With

alopecito
04-02-2009, 10:38 AM
1