Hi,
I have data from B1 to B80. To process this data, I have several parameters called Fixtime, Changetime
Fixtime is chosen by the user (lets assume a value of 2)
Changetime starts in 0.5
The general formula i need to use would be (which increases as cell increases): Results = Value_of_B*Changetime*Fixtime
As an example, in excel I can simply create a cell formula to obtain the results I need:
D1 = B1*0.5*2
D2 = B1*1.5*2 + B2*0.5*2
D3 = B1*2.5*2 + B2*1.5*2 + B3*0.5*2
D4 = B1*3.5*2 + B2*2.5*2 + B3*1.5*2 + B4*1.5*2
D5 = B1*4.5*2 + B2*3.5*2 + B3*2.5*2 + B4*1.5*2 + B5*0.5*2
.
.
D80 = .....
Note how the values of 0.5 (Changetime) are varying as the next D cell is required, each time one additional value is summed and at the same time "changetime" values increase.
As you can imagine, to do this up to D80 is annoying and takes time, once is there, is easier, but is not efficient.
I was wondering if any of the vba experts would have a cheap, simple and fast solution of a code to fill D1 to D80 and by doing the same exact calculations as in the example I presented, my problem is basically on how to loop (though I heard looping was not recommended as it is slow) to achieve the desired calculation.
Hope you can help.
Thanks in advance.
I have data from B1 to B80. To process this data, I have several parameters called Fixtime, Changetime
Fixtime is chosen by the user (lets assume a value of 2)
Changetime starts in 0.5
The general formula i need to use would be (which increases as cell increases): Results = Value_of_B*Changetime*Fixtime
As an example, in excel I can simply create a cell formula to obtain the results I need:
D1 = B1*0.5*2
D2 = B1*1.5*2 + B2*0.5*2
D3 = B1*2.5*2 + B2*1.5*2 + B3*0.5*2
D4 = B1*3.5*2 + B2*2.5*2 + B3*1.5*2 + B4*1.5*2
D5 = B1*4.5*2 + B2*3.5*2 + B3*2.5*2 + B4*1.5*2 + B5*0.5*2
.
.
D80 = .....
Note how the values of 0.5 (Changetime) are varying as the next D cell is required, each time one additional value is summed and at the same time "changetime" values increase.
As you can imagine, to do this up to D80 is annoying and takes time, once is there, is easier, but is not efficient.
I was wondering if any of the vba experts would have a cheap, simple and fast solution of a code to fill D1 to D80 and by doing the same exact calculations as in the example I presented, my problem is basically on how to loop (though I heard looping was not recommended as it is slow) to achieve the desired calculation.
Hope you can help.
Thanks in advance.