Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro when Inserting Line


Hi, I need a macro whereby:

When I insert a line the formulae from the rows above are copied down,

Many Thanks


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=475771

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Macro when Inserting Line

David McRitchie has one you could review at:
http://www.mvps.org/dmcritchie/excel/insrtrow.htm
look for: InsertRowsAndFillFormulas

T De Villiers wrote:

Hi, I need a macro whereby:

When I insert a line the formulae from the rows above are copied down,

Many Thanks

--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=475771


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Macro when Inserting Line

Below just inserts a row and copies the formulas from the above row and moves
it down.

Sub copyrow()
Rows("2:2").Insert Shift:=xlDown
Rows("1:1").Copy
Rows("2:2").PasteSpecial Paste:=xlPasteFormulas
Application.CutCopyMode = False
End Sub

You could use
Selection.Insert Shift:=xlDown
In the first row if you want to first select the row you would like inserted
and then run the macro.


"T De Villiers" wrote:


Hi, I need a macro whereby:

When I insert a line the formulae from the rows above are copied down,

Many Thanks


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=475771


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
I need a macro for inserting a border line every 20 rows Adamp Excel Discussion (Misc queries) 9 August 20th 08 07:56 PM
Inserting a line S.C Excel Worksheet Functions 1 April 10th 07 08:28 AM
Inserting a new line in spreadsheet Rental Man Excel Discussion (Misc queries) 2 January 9th 06 04:55 PM
Macro problem on, Yellowed line - previous line or next line. Ed Excel Programming 7 March 29th 05 09:37 PM
Inserting a line.... Brady Snow[_2_] Excel Programming 1 July 13th 04 05:10 PM


All times are GMT +1. The time now is 06:54 AM.

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

About Us

"It's about Microsoft Excel"