S
Steve C
This should be so simple, but I'm struggling. I want to sum a column of
contiguous numbers and put the total in the first empty cell beneath them.
The number of cells summed varies depending on the column.
When recording this and reviewing the code, the VB Editor gives me the
following:
ActiveCell.FormulaR1C1 = "=SUM(R[-15]C:R[-1]C)"
where -15 is the number of cells to be added. Of course, this changes
depending on the number of cells to be added. I've tried creating a variable
(COUNT) that stores the number of cells to be added and putting it in the
formula as follows, but it only gives me an error message:
ActiveCell.FormulaR1C1 = "=SUM(R[-COUNT]C:R[-1]C)"
I'm sure there's an infinitely easier way to do this. Thanks in advance for
any suggestions!
contiguous numbers and put the total in the first empty cell beneath them.
The number of cells summed varies depending on the column.
When recording this and reviewing the code, the VB Editor gives me the
following:
ActiveCell.FormulaR1C1 = "=SUM(R[-15]C:R[-1]C)"
where -15 is the number of cells to be added. Of course, this changes
depending on the number of cells to be added. I've tried creating a variable
(COUNT) that stores the number of cells to be added and putting it in the
formula as follows, but it only gives me an error message:
ActiveCell.FormulaR1C1 = "=SUM(R[-COUNT]C:R[-1]C)"
I'm sure there's an infinitely easier way to do this. Thanks in advance for
any suggestions!