View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Debra Dalgleish Debra Dalgleish is offline
external usenet poster
 
Posts: 2,979
Default VBA : VBA code for summation formula

The following code will enter a SUM formula that totals from Row 2 to
the row above the active cell:

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

david2004 < wrote:
I need a VBA code for a summation formula. I have a column of values
which are calculated by a formula.But the value of the second cell
below the 1st cell in the column is a summation of the calculated value
in the 1st + 2nd cell of the same column and the 3rd cell below the top
is a summation of the 3 calculated values and subsequently for a column
of 10 rows.
Each cell in the column uses the same formula with input according to
the row in ascending order.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html