Hi,
I'm trying to write a code that will add the values of a range of cells. The range will always be in column E. It will always start in the cell E8 and finish on the last used cell in that column. The sum is meant to be displayed in the cell below last.
Sounds simple enough, doesn't it?
This is what I've got:
Sub AddValues()
Range("E65536").End(xlUp).Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "=Sum(E8:R[-1]C)"
End Sub
Every time I run the macro an apostrophe gets added on each side of E8 (it becomes 'E8') and an error comes up.
Any advise on how to overcome this?
Please.
I'm trying to write a code that will add the values of a range of cells. The range will always be in column E. It will always start in the cell E8 and finish on the last used cell in that column. The sum is meant to be displayed in the cell below last.
Sounds simple enough, doesn't it?
This is what I've got:
Sub AddValues()
Range("E65536").End(xlUp).Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "=Sum(E8:R[-1]C)"
End Sub
Every time I run the macro an apostrophe gets added on each side of E8 (it becomes 'E8') and an error comes up.
Any advise on how to overcome this?
Please.