S
Sue
I need to enter a sum formula by code.
I can establish the coordinates of the range in R1C1 form.
Say the points are (subrow1,subcol1) and (subrow2,subcol2).
I can get where I want to put the formula.
I have tried:
ActiveCell.FormulaR1C1="=sum(R[subrow1]C[subcol1]):R[subrow2]C[subcol2])
or ActiveCell.FormulaR1C1="=sum(R[subrow1]C[-1]:R[subrow2]C[-1])
- as the column is adjacent - and variations on the theme but everything
with a variable in it produces a run time error.
I need the total of a variable amount of the column (which is adjacent to
where the total is required.) The formula can not be turned into a fixed
offset but must be a range from the two points. Help!
I can establish the coordinates of the range in R1C1 form.
Say the points are (subrow1,subcol1) and (subrow2,subcol2).
I can get where I want to put the formula.
I have tried:
ActiveCell.FormulaR1C1="=sum(R[subrow1]C[subcol1]):R[subrow2]C[subcol2])
or ActiveCell.FormulaR1C1="=sum(R[subrow1]C[-1]:R[subrow2]C[-1])
- as the column is adjacent - and variations on the theme but everything
with a variable in it produces a run time error.
I need the total of a variable amount of the column (which is adjacent to
where the total is required.) The formula can not be turned into a fixed
offset but must be a range from the two points. Help!