Inserting Rows and copying data.

Yokiboha

Board Regular
Joined
Feb 21, 2007
Messages
207
I have a sheet with unique rows into which I insert 2 blank rows after each filled row.

I need to copy into the two blank rows the data in the row immediately above them. Can anybody give me an easy way to do this?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
The following code assumes data starts from A2:

Code:
Sub CopyInsertRows()
  LastRow = Cells(Rows.Count, 1).End(xlUp).Row
  Set DatRng = Range("A2", Cells(LastRow, 1))
  For i = LastRow To 2 Step -1
    Cells(i, 1).EntireRow.Copy
    Rows(i + 1).Resize(2, Columns.Count).Insert Shift:=xlDown
  Next i
  Application.CutCopyMode = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,108
Messages
6,128,872
Members
449,475
Latest member
Parik11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top