Thread: SUM in VBA
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default SUM in VBA

Hi Steve,

Try:

ActiveCell.FormulaR1C1 = "=SUM(R3C:R[-1]C)"


---
Regards,
Norman



"Steve Pollack" wrote in message
...
I would like to insert into a macro an instruction to insert the formula
that
sums all the cells (in the existing column) from row 3 to the row just
above
the cell with the SUM formula.
I have tried the following without success (generates a VBA error):

ActiveCell.FormulaR1C1 = "=SUM(R[-3]C:R[ActiveCell.Offset(-1)]C)"

If someone could help, I would be most grateful.
Thanks.