Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Insert Row & Copy Formula

Could someone please help me with the code to insert a row below the current
row and copy the formula in named range ("Telephone") into the new row
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Insert Row & Copy Formula

Sub insertrow()

Set telephone = Range("I114")

Range(Cells(ActiveCell.Row + 1, ActiveCell.Column), _
Cells(ActiveCell.Row + 1, ActiveCell.Column + 1)). _
EntireRow.Insert Shift:=xlDown

Cells(ActiveCell.Row + 1#, ActiveCell.Column).Formula = telephone.Formula

End Sub
"Karen McKenzie" wrote:

Could someone please help me with the code to insert a row below the current
row and copy the formula in named range ("Telephone") into the new row

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Insert Row & Copy Formula

Based on the brevity and lack of specificity in your post, many assumptions
are made:

Is telephone a single cell?

Activecell.offset(1,0).EntireRow.Insert
Activecell.offset(1,0).Formula = Range("Telephone").formula

if Telephone contains a formula that should be copied to allow relative
references to adjust:

Activecell.offset(1,0).EntireRow.Insert
Range("Telephone").copy ActiveCell.offset(1,0)

--
Regards,
Tom Ogilvy


"Karen McKenzie" wrote:

Could someone please help me with the code to insert a row below the current
row and copy the formula in named range ("Telephone") into the new row

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
insert new row and copy formula bumiblumi Excel Worksheet Functions 1 December 2nd 09 08:12 PM
Insert Row - Copy Formula From The Row Above Phendrena Excel Discussion (Misc queries) 3 August 19th 08 07:18 PM
insert row and copy formula Andy B Excel Discussion (Misc queries) 4 May 29th 07 02:44 PM
insert row and copy formula mark kubicki Excel Programming 2 May 10th 06 03:17 AM
Insert Row & Copy Formula redruthann Excel Worksheet Functions 0 March 26th 06 11:51 PM


All times are GMT +1. The time now is 07:36 PM.

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"