Thread: SUM in VBA
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Steve Pollack Steve Pollack is offline
external usenet poster
 
Posts: 2
Default SUM in VBA

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.