How do i do autosum in excel i tried recording it but i got
Range("J22").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-20]C:R[-1]C)"
But the range i have to add changes in size could anyone help???
Printable View
How do i do autosum in excel i tried recording it but i got
Range("J22").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-20]C:R[-1]C)"
But the range i have to add changes in size could anyone help???
Just dynamically build the range, i.e.
ActiveCell.FormulaR1C1 = "=SUM(R[-" & AComputedValue & "]C:R[-" & AnotherComptedValueOR1" & "]C)"
Could always use a more simple approach like this:
ActiveCell.Formula = "=SUM(C2:C6)"
Suppose the range i had to add is A2:BA2 then wheather tha same formula is applicable.