I am unsure how to correct this code in VBA.
The result is debugged in this image below.
http://tinypic.com/r/33usx6s/9
Here is the screenshot of what happens when I click run on the excel file.
http://tinypic.com/r/1495j7s/9
I am new to vba. I don't know why in the first image, there is an Error 2029 displayed when debugging for both the variables. Does this mean that there is something wrong with my formula? How do I correct this.
I'm trying to get the VBA code to run so that the summation in column 4 row 22 is outputted onto each row of column 10 for the monthly kW calculations. Appreciate any help.
Code:
Sub Macro4()
'
' Macro4 Macro
'
'
For i = 2 To 13
Dim Speed As Double
Speed = Cells(i, 9).Value
Range("C2").Select
ActiveCell.FormulaR1C1 = _
"=(R2C13*0.89/Speed)*((RC[-2]*0.89/Speed)^(R2C13-1))*(EXP(-((RC[-2]*0.89/Speed)^R2C13)))"
A = ActiveCell.Value
Selection.AutoFill Destination:=Range("C2:C21"), Type:=xlFillDefault
Cells(i, 10) = "=R22C4"
B = ActiveCell.Value
Next i
End Sub
The result is debugged in this image below.
http://tinypic.com/r/33usx6s/9
Here is the screenshot of what happens when I click run on the excel file.
http://tinypic.com/r/1495j7s/9
I am new to vba. I don't know why in the first image, there is an Error 2029 displayed when debugging for both the variables. Does this mean that there is something wrong with my formula? How do I correct this.
I'm trying to get the VBA code to run so that the summation in column 4 row 22 is outputted onto each row of column 10 for the monthly kW calculations. Appreciate any help.