Please help me with looping


Posted by Mark Foss on August 23, 2001 10:34 AM

Hi, and thanks for the help. I need a formula for VB that will write a formula through an entire column with a formula that looks like this
the first formula should be:
"=CONCATENATE("AH",SUM(I4))
the scond formula should be:
"=CONCATENATE("AH",SUM(I4:I5))
third:
"=CONCATENATE("AH",SUM(I4:I6))
fourth:
"=CONCATENATE("AH",SUM(I4:I7))
and so on. I am pretty sure there is an easy way to do this so any help would be greatly appriciated.

Thank you very much,

Mark

Posted by Barrie Davidson on August 23, 2001 11:30 AM

Mark, you could use this formula in the first cell and then copy down.

="AH"&SUM($I$4:I4)

Barrie



Posted by Gordon on August 23, 2001 5:28 PM


To enter the formula in cells A1:A10, the following code could be used (it is not necessary to select A1:A10) :-

Range("A1:A10").FormulaR1C1 = "=""AH"" & SUM(R1C9:RC9)"