Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Auto-copy of formula on inserted lines | Excel Discussion (Misc queries) | |||
Can array formulas work if rows are inserted? | Excel Worksheet Functions | |||
How do i copy only the subtotals inserted into a list? | Excel Discussion (Misc queries) | |||
Need macro to copy a list of named cells between worksheets | Excel Worksheet Functions | |||
copy macro assigned buttons in an array | Excel Worksheet Functions |