I am trying to use the custom variable "Index" so that I can use this macro on arbitrarily long data sets.
I'm trying to directly add this variable in the FormulaR1C1 notation I used below. Is there some way of referencing it? Below I tried concatenating it with the & sign but that does not work.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/30/2007 by bendej3
'
'
LastRowColA = Range("A65536").End(xlUp).Row
Index = -LastRowColA + 1
Range("A" & (LastRowColA + 1)).Select
ActiveCell.FormulaR1C1 = "Sum"
Range("C" & (LastRowColA + 1)).Select
ActiveCell.FormulaR1C1 = _
"=SUMIF(R["&Index&"]C[-1]:R[-1]C[-1],""All Parameters"",R["&Index&"]C:R[-1]C)"
End Sub
Thanks!
I'm trying to directly add this variable in the FormulaR1C1 notation I used below. Is there some way of referencing it? Below I tried concatenating it with the & sign but that does not work.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/30/2007 by bendej3
'
'
LastRowColA = Range("A65536").End(xlUp).Row
Index = -LastRowColA + 1
Range("A" & (LastRowColA + 1)).Select
ActiveCell.FormulaR1C1 = "Sum"
Range("C" & (LastRowColA + 1)).Select
ActiveCell.FormulaR1C1 = _
"=SUMIF(R["&Index&"]C[-1]:R[-1]C[-1],""All Parameters"",R["&Index&"]C:R[-1]C)"
End Sub
Thanks!