After I have selected a range containing numerical values, I want to, via VBA, input a =SUM
formula at the bottom of each column, i.e. on the row after the last selected row. For each column it should sum all of the values in the corresponding column of the entire selection.
How can I do this?
Right now, I am using the code given by the macro recorder: ActiveCell.FormulaR1C1 = "=SUM(R[-10]C:R[-1]C)"
. The problem is when my range gets bigger than 10 rows it will not take the rows above the bottom 10 into consideration.