Public Function fact(n) As Double Dim j As Long On Error GoTo suberr fact = 1 If n > 1 Then For j = 1 To n fact = fact * j Next

End If Exit Function suberr: fact = CDbl(nulllong)

End Function

Private Sub CommandButton1_Click() Dim l As Double Dim i As Integer Dim j As Integer Dim acum As Double

l = TextBox1

acum = 0 For i = 0 To 99

4) = acum Next i For j = 1 To 1000 For i = 0 To 99 If Hoja1.1 GoTo fin End If Next i fin: Hoja1.Cells(j + 1. 4) Then Hoja1.Cells(j + 1. 3) = (Exp(-l) * (l ^ i)) / fact(i) acum = acum + (Exp(-l) * (l ^ i)) / fact(i) Hoja1.Cells(i + 2. 1)) Next j End Sub Private Sub UserForm_Click() End Sub .Cells(i + 2. 1) < Hoja1.Cells(i + 2.Cells(i + 2.Hoja1.Cells(j + 1.Cells(j + 1. 6) = -(1 / l) * Log(Hoja1. 2) = i Hoja1. 5) = i .

Sign up to vote on this title
UsefulNot useful