Im trying to create an excel macro to select a range of cells then insert new row every other row then copy and paste each row.
For example.
apples |
oranges |
mangos |
My desired goal is
apples |
apples |
oranges |
oranges |
mangos |
mangos |
I have thousands of rows and a macro would be nice.
This Inserts a new row,every other row.
Sub InsertNewRows()
Dim rng As Range
Dim CountRow As Integer
Dim i As Integer
Set rng = Selection
CountRow = rng.EntireRow.Count
For i = 1 To CountRow
ActiveCell.Offset(1, 0).EntireRow.Insert
ActiveCell.Offset(2, 0).Select
Next i
End Sub
How can I duplicate the lines in the range too?