+ Reply to Thread
Results 1 to 2 of 2

Array Problem

  1. #1
    Registered User
    Join Date
    10-08-2011
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    3

    Array Problem

    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

  2. #2
    Registered User
    Join Date
    10-08-2011
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Array Problem. Please Help!!

    Help! Please.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1