vba excel: do something every time a certain variable is changed
        Posted  
        
            by every_answer_gets_a_point
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by every_answer_gets_a_point
        
        
        
        Published on 2010-03-16T22:34:36Z
        Indexed on 
            2010/03/16
            23:41 UTC
        
        
        Read the original article
        Hit count: 299
        
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?
© Stack Overflow or respective owner