時間我做了一堆東西給變量St
VBA擅長:每某個變量發生變化
For i = 1 To 30000
Randomize
e1 = Rnd
e2 = Rnd
z1 = Sqr(-2 * Log(e1)) * Cos(2 * 3.14 * e2)
z2 = Sqr(-2 * Log(e1)) * Sin(2 * 3.14 * e2)
St = So * Exp((r - (sigma^2)/2) * T + sigma * Sqr(T) * z1)
C = C + Application.WorksheetFunction.Max(St - K, 0)
St = So * Exp((r - (sigma^2)/2) * T - sigma * Sqr(T) * z1)
C = C + Application.WorksheetFunction.Max(St - K, 0)
St = So * Exp((r - (sigma^2)/2) * T + sigma * Sqr(T) * z2)
C = C + Application.WorksheetFunction.Max(St - K, 0)
St = So * Exp((r - (sigma^2)/2) * T - sigma * Sqr(T) * z2)
C = C + Application.WorksheetFunction.Max(St - K, 0)
Next i
我怎麼得到通知,每次變量的變化做一些事情?
順便說一句:'Pi = 4 * Atn(1)'in VBA – Tomalak 2010-03-16 22:46:05