I can create a macro that will SUM that perfectly, regardless of which column it is in.
But the macro will ALWAYS sum 5 rows. I cannot get it to recognize the number of values in the range and only SUM those values.
Here's the code for my macro.
- Code: Select all
Sub Macro22()
'
' Macro22 Macro
' With Relative References turned on.
'
' Keyboard Shortcut: Ctrl+o
'
ActiveCell.FormulaR1C1 = "=SUM(R[-5]C:R[-1]C)"
End Sub
Any and all advice would be much appreciated.