Hi,

I have a simple program like this:

Private Sub Command1_Click()
Dim the_number As Integer
the_number = Int(Rnd * 50)
Text1 = the_number
End Sub

So say Text1 comes up as '23'.

Then, when I click another button, command2, I want the sum of all numbers, from 1 to 22 (1+2+3+4...etc..+22) to appear in Text2.

Does anyone know how I could do this? I think it's some sort of Loop or something, but I'm not sure how.