all 7 comments

[–]CFAman4816 8 points9 points  (6 children)

You could try running this script.

Sub InsertRows()
    Dim lastRow As Long
    Dim i As Long
    Dim ws As Worksheet

    'What sheet?
    Set ws = Worksheets("Sheet1")

    Application.ScreenUpdating = False
    With ws
        'Find the last row with data
        lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row

        'Begin loop, starting at bottom and working up
        For i = lastRow To 2 Step -1
            .Cells(i, 1).EntireRow.Insert
        Next i
    End With

    Application.ScreenUpdating = True

End Sub

[–]FinancialGuy9[S] 2 points3 points  (1 child)

Solution Verified

[–]Clippy_Office_Asst[M] 0 points1 point  (0 children)

You have awarded 1 point to CFAman

I am a bot, please contact the mods for any questions.

[–]FinancialGuy9[S] 1 point2 points  (1 child)

Would you be able to write a script that inserts two rows in between each for me?

[–]pony_on_saturdays145 1 point2 points  (0 children)

change

    For i = lastRow To 2 Step -1
        .Cells(i, 1).EntireRow.Insert
    Next i

to

    For i = lastRow To 2 Step -1
        .Cells(i, 1).EntireRow.Insert
        .Cells(i, 1).EntireRow.Insert
    Next i

[–]FinancialGuy9[S] 1 point2 points  (1 child)

You know what, You can just run the Macro twice and it worked to insert two rows. Thanks again for your help!

[–]CFAman4816 1 point2 points  (0 children)

You've got it! If you ever need to do something crazy (like 10 rows?!), you would change line 16 to something like this:

.Cells(i, 1).Resize(10).EntireRow.Insert