Dear friends
I am quite new to VBA and I am hoping for some help.
I the code below I notice that the variables are not initialised with the values specified? Could anyone tell my what that is?
Many thanks
Option Base 0
Sub GBM()
Dim i As Long
Dim S(10000) As Long
Dim mu As Integer
Dim t As Integer
Dim Sigma As Integer
mu = 0.1
t = 1
Std = 0.2
S(0) = 100
For i = 0 To 9999
S(i + 1) = S(i) * mu * t + Application.NormSDist(Rnd) * Sqr(t) * Sigma
Range("A1").Offset(i + 1, 1).Value = S(i)
Next i
End Sub
Bookmarks