View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Darren Hill[_2_] Darren Hill[_2_] is offline
external usenet poster
 
Posts: 80
Default Whats wrong with this VBA statement -ActiveCell.FormulaR1C1...?

Try

ActiveCell.FormulaR1C1 = "=SUM(R[-" & Range("j1").Value & "]C:R[-1]C)"


--
Darren

"hal" wrote in message
...
ActiveCell.FormulaR1C1 = "=SUM(R[-(Range("j1").Value)]C:R[-1]C)"

I am trying to put a formula in the active cell to sum a list of numbers

starting from 1 row up, to the number of rows up that is equal to the value
in the cell j1. In other word if the value in the cell j1 was 9, I need to
sum from 1 row up to 9 rows up.

Thank you in advance for any help.