Private Sub Command1_Click()
n = 0
s = 0
While s <= 1000
n = n + 1
s = s + n * n
Wend
Print "n="; n, "s="; s
End Sub