dim s as long,n as integer
For n=1 to 30000
if s +n >=30000 Then Exit For
s=s+n
Next
Msgbox "最大数是" & n