Results 1 to 3 of 3

Thread: random number

  1. #1

    Thread Starter
    Lively Member MHENK's Avatar
    Join Date
    Sep 2001
    Location
    Wisconsin
    Posts
    99

    random number

    I need my program to generate a random number, but it can only be 1,2,or 3. How do I do this???

    -MHENK

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    MsgBox Int((3 * Rnd) + 1)
    -= a peet post =-

  3. #3
    Matthew Gates
    Guest
    Try this:


    VB Code:
    1. Private Sub Command1_Click()
    2.     Randomize Timer
    3.     MsgBox Int((Rnd * 3) + 1)
    4. End Sub

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