Results 1 to 11 of 11
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Worksheet function (not VBA function) Randomize (Excel)

    MSFT KB article Q213660 refers to a Randomize() worksheet function in Excel, in
    addition to the Randomize in VBA, but I cannot find any Excel Help for that
    function.

    Where's the documentaton?

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Worksheet function (not VBA function) Randomize (Excel)

    The Worksheet functions are =RAND( ) and =RANDBETWEEN(highest,lowest).
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Worksheet function (not VBA function) Randomize (Excel)

    Yes, but to what is the KB article referring?
    After all, MSFT would never release an incorrect KB article, n'est-ce pas?

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Worksheet function (not VBA function) Randomize (Excel)

    <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

    <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    -John ... I float in liquid gardens
    UTC -7ąDS

  5. #5
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Worksheet function (not VBA function) Randomize (Excel)

    Obviousily, the worksheet randomize functions are named =RAND( ) and =RANDBETWEEN(highest,lowest).
    Legare Coleman

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Worksheet function (not VBA function) Randomize (Excel)

    The KB article lists those worksheet functions that are not accessible to VBA, since VBA has it's own function for them. Using native VBA functions is much more efficient than using the Excel worksheetfunction equivalent.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  7. #7
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Worksheet function (not VBA function) Randomize (Excel)

    Yes, but it does list a Randomize worksheet function.
    Somebody indicated that the Randomize function might be in the Analysis Tool Kit.
    I haven't look there yet.

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Worksheet function (not VBA function) Randomize (Excel)

    It is no worksheet function, it is a VBA statement. From VBA Help:

    Randomize Statement


    Initializes the random-number generator.

    Syntax

    Randomize [number]

    The optional number argument is a Variant or any valid numeric expression.

    Remarks

    Randomize uses number to initialize the Rnd function's random-number generator, giving it a new seed value. If you omit number, the value returned by the system timer is used as the new seed value.

    If Randomize is not used, the Rnd function (with no arguments) uses the same number as a seed the first time it is called, and thereafter uses the last generated number as a seed value.

    Note To repeat sequences of random numbers, call Rnd with a negative argument immediately before using Randomize with a numeric argument. Using Randomize with the same value for number does not repeat the previous sequence.

    Randomize Statement Example
    This example uses the Randomize statement to initialize the random-number generator. Because the number argument has been omitted, Randomize uses the return value from the Timer function as the new seed value.

    Dim MyValue
    Randomize ' Initialize random-number generator.

    MyValue = Int((6 * Rnd) + 1) ' Generate random value between 1 and 6.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  9. #9
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Worksheet function (not VBA function) Randomize (Excel)

    I was aware of the VBA statement, I was asking about the worksheet function Randomize listed in the apparently incorect KB article.

    Note that the ATP provides the functionality I sought.

  10. #10
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Worksheet function (not VBA function) Randomize (Excel)

    Indeed the KB article is wrong.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  11. #11
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Worksheet function (not VBA function) Randomize (Excel)

    Unfortunately, all too many KB articles are wrong.

Posting Permissions

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