Re: Anyone good at VB?
You could do something like this for the output
s = "initial data: "
for i = 0 to 29
s = s & a(i) & " "
If (i+1) Mod 10 = 0 Then
s = s & vbNewLine
End If
next i
msgbox s
and for the first loop you could do it all in one, ala:
for i = 0 to 29
if i < 10 then a(i) = 11 * i
if i >=10 and i <=19 then a(i) = -i
if i > 19 then a(i) = i
next i
Or you could use a case statement.
|