Hi all,
I need a function that takes a random NUMBER from 0 to 35. Something like:
Is this possible, and does anyone now ho I can do this?VB Code:
number = random (0, 35)
Printable View
Hi all,
I need a function that takes a random NUMBER from 0 to 35. Something like:
Is this possible, and does anyone now ho I can do this?VB Code:
number = random (0, 35)
look at the Rnd() function in msdn to see the syntax plus always put Randomize in the form load event when dealing with ramdom numbers.VB Code:
Private Sub Form_Load() Randomize End Sub Private Sub Command1_Click() Dim num As Integer num = Int(Rnd * 36) MsgBox num End Sub
casey.
Quote:
Originally Posted by vbasicgirl
This gives an errorVB Code:
Randomize End Sub
[edit]It works without the "End Sub".[/edit]