Sub compute()
Dim Arr(0 To 40), Average, Std_Dev, Iterations, Lambda As Variant
Lambda = 1.123121241414
Iterations = UBound(Arr)
For i = 1 To Iterations
Randomize
Prob = Rnd()
a = Application.WorksheetFunction.Ln(1 - Prob) / (-Lambda)
Sheets("Sheet3").Cells(i, 1) = a
Arr(i) = a
Next i
Average = Application.WorksheetFunction.Average(Arr)
Std_Dev = Application.WorksheetFunction.StDev(Arr)
Sum = Application.WorksheetFunction.Sum(Arr)
Sheets("Sheet3").Cells(1, 2) = Average
Sheets("Sheet3").Cells(1, 3) = Std_Dev
Sheets("Sheet3").Cells(1, 4) = Sum
End Sub
Question: If i want the range in arr( xxx to xxx) become a random constant, How can i make it. Please Help
Bookmarks