Editing Marco

J

JBoyer

This is the formula I was reccomended by another user and it does everything
I asked for except I have one new request. This is the marco I now am using:
Sub InsertFiveRows()
Dim LastRow As Long
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
v = Rows(LastRow - 1).Formula
Cells(LastRow - 1, "A").Resize(5, 1).EntireRow.Insert
Rows(LastRow - 1) = v
Rows(LastRow + 4).ClearContents
Range("AU1:BF5").Copy Cells(LastRow, "A")
End Sub

I want this to also drag down the formula in the M column five rows
 
J

JR Form

Use the same code just make a few M changes-
Add this to the bottom of your current macro.

Dim LastRowM As Long
Dim vM As Variant
LastRow = Cells(Rows.Count, "M").End(xlUp).Row
vM = Rows(LastRow - 1).Formula
Cells(LastRow - 1, "M").Resize(5, 1).EntireRow.Insert
Rows(LastRow - 1) = vM
Rows(LastRow + 4).ClearContents
Range("AU1:BF5").Copy Cells(LastRow, "M")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top