View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Range Formula Problem

I guess I misunderstood your request. If you are saying that you want to
create new formulas from ONLY the inserted row then please provide your
complete code and examples of before and after formulas for several rows or
send me a file with a clear explanation.

--
Don Guillett
SalesAid Software

"David" wrote in message
...
OK...I've got the named range...now how do I update the formulas from the
row
inserted to the last row in the range?
Thanks!

"Don Guillett" wrote:

Why not just use a defined name to self adjust the range
insertnamedefinename it as desired "myrng"in the refers to box
=offset($a$1,1,0,counta($a:$a)-1,6)
look in the help index for OFFSET. Modify to suit
BTW. In your macros, selections are RARELY necessary or desirable

--
Don Guillett
SalesAid Software

"David" wrote in message
...
I have a range BFP (A11:A33) that has 3 columns of formulas (C, D, E)
that
use SumProduct that refers to cells on the current sheet and cells on
another
sheet. This is the formula in Column C: (SUMPRODUCT(O78:Z78,'2006
Actual'!C10:N10)/1000). Column D & E use same formula, but refer to
other
sheets. When I insert a row, I need to update the formulas starting
with
the
inserted row down to the last row to update the formulas for the other
sheets. But since the last row address in the BFP Range changes, I
cannot
figure out how to get the row address to copy the formula down to. I'm
probably making this too hard, but here is the macro I started, before
I
came
up with the range name.

Sheets("Growth Rates").Activate
Rows(RowNum).Select
Selection.Insert Shift:=xlDown
Range("A" & RowNumM1 & ":" & "H" & RowNumM1).Select
Selection.Copy
Range("A" & RowNum).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("C" & RowNumM1 & ":" & "E" & RowNumM1).Select
Selection.AutoFill Destination:=Range("C" & RowNumM1 & ":" &
"E"
& RowNum), Type:=xlFillDefault
Range("C" & RowNumM1 & ":" & "E" & RowNum).Select

I used an input box to get the RowNum where the user wants to insert
the
new
row.
RowNumM1 is the RowNum - 1
I'm trying to get the RowNum of the last row in the range (I know I
need
another variable name) for the Selection.AutoFill Destination or maybe
there
is a more simple way. Any help would be appreciated.