Ranomize 6 numbers without repeating a number

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gobblegob
    New Member
    • Dec 2007
    • 133

    Ranomize 6 numbers without repeating a number

    Hi guys i am trying to randomize 6 numbers into 6 textboxes up to the value of 60 without repeating a number but i dont know how an error handler would work for duplicate numbers any idea's?

    this is what i have so far:

    [CODE=vb]Text1.Text = Int(Rnd * 60) + 1
    Text2.Text = Int(Rnd * 60) + 1
    Text3.Text = Int(Rnd * 60) + 1
    Text4.Text = Int(Rnd * 60) + 1
    Text5.Text = Int(Rnd * 60) + 1
    Text6.Text = Int(Rnd * 60) + 1[/CODE]

    Thanks for any help in advanced
    Gobble.
    <<< btw VB 6 >>>
    Last edited by debasisdas; Feb 19 '08, 05:27 AM. Reason: added code=vb tags
  • rizwan6feb
    New Member
    • Jul 2007
    • 108

    #2
    Here is the code you need

    Comment

    Working...