Sub model_crr() S0 = Cells(1, 2) K = Cells(2, 2) t = Cells(3, 2) r = Cells(4, 2) sigma = Cells(5, 2) N = Cells(7, 2) delta_t = t / N Cells(8, 2) = delta_t u = Exp(sigma * delta_t ^ 0.5) Cells(9, 2) = u d = 1 / u Cells(10, 2) = d p = (Exp(r * delta_t) - d) / (u - d) Cells(11, 2) = p Cells(12, 2) = 1 - p For i = 0 To N Cells(3, 4 + i) = i Next i Dim S(100, 100) As Double Cells(4, 4) = S0 For i = 1 To N For j = 0 To i S(i, j) = S0 * u ^ j * d ^ (i - j) Cells(4 + i - j, 4 + i) = S(i, j) Next j Next i End Sub