Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How can a macro copy from a named array to an inserted row

I need a macro to locate a named row, insert a new row (immediately above it)
then copy formula from the named row to the newly created row. At the time of
creating the macro, it identifies the paste destination as an absolute
address, rather than relative to the named row. Consequently, it works only
once and subsequently doesn't copy to the newly created row but to the row it
first created which is specifically addressed in the the macro. Maybe there
is a relative cell movement command I could manually insert in the macro like
"UP"? I've tried various "tricks" including naming the new row, but can't
overcome the macro's capture of the original paste address. Can anybody
suggest a solution?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default How can a macro copy from a named array to an inserted row

Rather than copy the cell get the formula

MyFormula = Range("A6").formula
Range("A5") = Myformula

My

"JamesE" wrote:

I need a macro to locate a named row, insert a new row (immediately above it)
then copy formula from the named row to the newly created row. At the time of
creating the macro, it identifies the paste destination as an absolute
address, rather than relative to the named row. Consequently, it works only
once and subsequently doesn't copy to the newly created row but to the row it
first created which is specifically addressed in the the macro. Maybe there
is a relative cell movement command I could manually insert in the macro like
"UP"? I've tried various "tricks" including naming the new row, but can't
overcome the macro's capture of the original paste address. Can anybody
suggest a solution?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default How can a macro copy from a named array to an inserted row

Hi,

You could re-define the range every time the macro runs as your original row.

ActiveWorkbook.Names.Add Name:="Myrange", RefersToR1C1:="=Sheet1!R11"

The defines a named rang of "MyRange" which applies to row 11.

Mike

"JamesE" wrote:

I need a macro to locate a named row, insert a new row (immediately above it)
then copy formula from the named row to the newly created row. At the time of
creating the macro, it identifies the paste destination as an absolute
address, rather than relative to the named row. Consequently, it works only
once and subsequently doesn't copy to the newly created row but to the row it
first created which is specifically addressed in the the macro. Maybe there
is a relative cell movement command I could manually insert in the macro like
"UP"? I've tried various "tricks" including naming the new row, but can't
overcome the macro's capture of the original paste address. Can anybody
suggest a solution?

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
Auto-copy of formula on inserted lines RizzKid Excel Discussion (Misc queries) 0 January 28th 08 03:13 AM
Can array formulas work if rows are inserted? Chris Excel Worksheet Functions 1 March 16th 06 03:30 PM
How do i copy only the subtotals inserted into a list? scross88 Excel Discussion (Misc queries) 2 January 25th 06 06:53 PM
Need macro to copy a list of named cells between worksheets John Excel Worksheet Functions 3 January 8th 06 11:33 PM
copy macro assigned buttons in an array Phatboy_D Excel Worksheet Functions 1 December 1st 04 10:01 PM


All times are GMT +1. The time now is 01:59 AM.

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"