I was thinking about this for a while, thought I could do it, but then realised that I could be thinking about it all day and mightn't even acheive it.

I have a button on my form:

Private Sub Command1_Click()
dim randomnumber as integer
randomnumber = Int(rnd * 10) + 2
end sub

This generates a random number from 2 to 11

Then I have another button, command2.

When I click this I want the series of numbers, starting at 0 and ending at the number before randomnumber, to be printed in my label1.

For example:

randomnumber = 7

In label1 will be printed: 0,1,2,3,4,5,6

Does anybody have any code as to how this could be done. I bet you it's something like For x = 0 to randomnumber blah, blah, but I don't know much about that.

Thanks!