I am trying to get the following macro to work but it has two issues that i cant figure out how to fix.
1. It needs to copy and insert the cell formulas not the cell values.
2. For some reason when i run the macro is starts processing from the bottom of the sheet up. This might be fine but im not sure, it doesn't seem to be working so it might be causing issues.
What this macro should do is copy the formulas (not the values) of the 3rd and 4th rows from column A to the 50th column of my document.
It then inserts these two rows of data without replacing any other existing rows every second row till the end of the document. The document already contains about 7000 rows of data and the copied cells from rows 3 and 4 need to be inserted between every row of existing data.
My sheet is organized as follows
Header Row
2nd Row
3rd Row must be copied
4th Row must be copied
5th Row
6th Row
7th Row
...
7000th row
The copied cells should go between every row of data till the end of the sheet.
My code is as follows:
Sub insertMain()
Dim x
Application.ScreenUpdating = 0
x = Cells(3, 1).Resize(2, 50).Value
For i = Cells(Rows.Count, 2).End(xlUp).Row To 1 Step -1
j = 1
Do Until j > 2
Cells(i, 1).EntireRow.Insert
j = j + 1
Loop
Cells(i, 1).Resize(2, 50).Value = x
Next
Application.ScreenUpdating = 1
End Sub
Bookmarks