' Another way a little more random see "Randomize Statement"
' vba or vb help
Private Sub Label1_Click()
Dim n
' Initialize random-number generator.
' Uses the system timer
Randomize
' Generate random value between 1 and in this case 30.
n = Int((30 * Rnd) + 1)
Label1.Caption = n
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.