Hi,
I am having some trouble with the following piece of code:
t = 0
j = 3
For i = 1 To 100
t_m = t + i
**Worksheets("workings").Range("j,j+1").Value = Call_Eur
a = Log(s / x)
b = (r - q + (0.5 * (sd ^ 2))) * t_m
c = sd * (t_m ^ 0.5)
d1 = (a + b) / c
d2 = d1 - sd * (t_m ^ 0.5)
Call_Eur = (s * Exp(-q * t_m) * Hcumnorm(d1)) - (x * Exp(-r * t_m) *
Hcumnorm(d2))
**Worksheets("workings").Range("J+1,J+1").Value = Call_Eur
Next i
I am having trouble with the lines marked with 2 **.
I want the code to generate t_m and then score the values in some predetermined cells. Then, I want the code to use the values generated for t_m to calculate the values for Call_Eur, and then store the latter, once again, predetermined cells.
VBA says that there is a bug with code that i use to store the generated values in the cells.
Would anyone have an idea of what im doing wrong or how i could modify the code for it to do wot i want?
Thanks in advance.
AJ
