Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Editing Marco
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Editing Marco
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") "JBoyer" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Marco | Excel Programming | |||
Marco Editing Help | Excel Worksheet Functions | |||
help me with this marco | Excel Programming | |||
Marco | New Users to Excel | |||
marco | Excel Programming |