flo137

I am trying to create a program that will take 2 series of numbers and do a formula. I have the number 1-39 across row 1 in excel and 1-39 along column 1. the formula is

For counter = 1 To 39

ActiveCell.Select

ActiveCell.FormulaR1C1 = "=(0.4*RC[-1])+(0.6*RIdeac)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-2])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-3])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-4])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-5])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-6])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-7])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-8])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-9])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-10])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-11])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-12])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-13])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-14])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-15])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-16])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-17])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-18])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-19])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-20])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-21])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-22])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-23])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-24])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-25])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-26])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-27])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-28])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-29])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-30])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-31])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-32])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-33])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-34])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-35])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-36])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-37])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-38])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=(0.4*RC[-39])+(0.6*RIdeaC)"
ActiveCell.Offset(0, 1).Range("A1").Select

ActiveCell.Select
ActiveCell.Offset(1, -39).Range("a1").Select



Next counter

End Sub

this will allow me to get all = rows of cells complete if I manually place a -1 where the (i) is, but the data will always be taken from the previous cell.

the problem is that I want to create a loop that will change each variable (i) from -1 to -39 to fill the other 39 rows and columns correctly with the number from row 1 and column 1 respectively. please help