View Single Post
  #3  
Old 11-20-2007, 11:09 AM
Meech Meech is offline
Senior Member
 
Join Date: Nov 2004
Location: Meechigan
Posts: 1,159
Default 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.
Reply With Quote