PDA

Click to See Complete Forum and Search --> : Excel VB Formula


texas
Apr 5th, 2002, 01:01 PM
this is what I'm trying to do.

startD = 5
endD = 1

DateD = startD - endD

ActiveCell.FormulaR1C1 = "=SUM(RC[XXXXXX]:RC[-1])"


How do I get "DateD" in place of the "XXXXX" and have it work?

texas
Apr 5th, 2002, 01:50 PM
got it


DateD = (startD - endD) + 1

ActiveCell.FormulaR1C1 = "=SUM(RC[-" & DateD & "]:RC[-1])"