vba excel: do something every time a certain variable is changed
- by every_answer_gets_a_point
im doing a bunch of stuff to the variable St
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
how do i get notified every time the variable changes?