I have a macro in which I need to sum up several rows individually. My problem is that I do not know how many columns will be there ahead of time. Is there a way to use VBA to tell Excel just to click the Sum button in the toolbar?
As a second question on the same topic, is there a way to pass a variable into a SUM formula as in this example:
ActiveCell.FormulaR1C1 = "=SUM(RC[-LastColumn],RC[-1])"
where LastColumn is a variable defined earlier
As a second question on the same topic, is there a way to pass a variable into a SUM formula as in this example:
ActiveCell.FormulaR1C1 = "=SUM(RC[-LastColumn],RC[-1])"
where LastColumn is a variable defined earlier