Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Marco JBoyer Excel Programming 3 July 8th 08 10:49 PM
Marco Editing Help Gaffnr Excel Worksheet Functions 9 February 5th 08 04:20 PM
help me with this marco Gary Keramidas Excel Programming 1 April 22nd 06 02:01 AM
Marco Loi New Users to Excel 4 December 7th 04 08:52 PM
marco David Kuehl Excel Programming 4 September 18th 03 11:37 PM


All times are GMT +1. The time now is 10:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"