PDA

View Full Version : [SOLVED:] Set Integer to a Value



rmoon
06-23-2015, 06:11 AM
I'm working on growing a formula by one cell horizontally to change with the month that I am working in.

In order to accomplish this I need to set the integer that I have found as a value that I can use in a formula (in the FormulaR1C1Local line, use the value of i instead of writing i).Is there a way to do this?



Range("O5").Select
Dim i As Integer
i = -13 + Worksheets("Table of Contents").Range("H5") - 1
MsgBox i
FormulaR1C1Local = "=+SUM(RC[-13]:RC[i])"
Range("O6").Select
Range("O5").Select



Thanks

JKwan
06-23-2015, 06:42 AM
is this what you mean?



FormulaR1C1Local = "=+SUM(RC[-13]:RC[" & i & "])"

rmoon
06-23-2015, 06:54 AM
Yes thank you!