Hi,
in a certain formula ( ActiveCell.FormulaR1C1 = "=SUM(R[-12]C:R[-1]C)" ) i need the first reference, in this case [-12], i need to change it dynamically (with a variable ), how is this done?
Thanks in adance
Erwin
Hi,
in a certain formula ( ActiveCell.FormulaR1C1 = "=SUM(R[-12]C:R[-1]C)" ) i need the first reference, in this case [-12], i need to change it dynamically (with a variable ), how is this done?
Thanks in adance
Erwin
( ActiveCell.FormulaR1C1 = "=SUM(R[-" &
12 + x &
"]C:R[-1]C)" )
Without the returns of course.
Please Login or Register to view this content.
Last edited by Kalithro; 08-30-2013 at 06:42 PM.
Maybe something like this...
ActiveCell.FormulaR1C1 = "=SUM(R[" & x & "]C:R[-1]C)"
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks