Results 1 to 4 of 4

Thread: Generating a random number?

  1. #1

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    32

    Generating a random number?

    Is there anyway to make VB generate a random number.
    eg.
    Integer = Random(0,200)
    so it would pick a number between 0 and 200

  2. #2
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Generating a random number?

    Yes. You can use the Rnd function
    VB Code:
    1. MSgbox Rnd * 200
    CS

  3. #3
    Addicted Member Piller's Avatar
    Join Date
    Oct 2004
    Location
    california
    Posts
    177

    Re: Generating a random number?

    VB Code:
    1. Randomize
    2. MsgBox Int(Rnd * 200) + 1

    That will display a random whole number between 1 to 200.
    Are we alive or just breathing?

  4. #4

Posting Permissions

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



Click Here to Expand Forum to Full Width