View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
monir monir is offline
external usenet poster
 
Posts: 215
Default Loop for a Complex Formula

It works! You need, however, to introduce a separate Counter for the
destination column since it is not related to the destination row index i.

Counter = 0
For i = 12 To 8 Step -1 'destination rows 12 to 8, destination cols
Q::17 to U::21
Counter = Counter + 1
Set myFormula = myFormula.Offset(, 1)
myFormula.Formula = "=C21*$D$" & i & "^D21*$E$" & i & "^E21*$F$" & i &
"^F21*... "
Cells(i, 16 + Counter).Formula = "=sum(" &
myFormula.Rows().Address(False, True) & ")"
Next i

Thank you.


"Bob Phillips" wrote:

I think that should be

"gocush" /delete wrote in message

"monir" wrote: