Hi. Pls copy paste this to your form module.

Option Base 1
Private Sub Command1_Click()
 
 Dim mArray(15) As Integer
 
 For x = LBound(mArray) To UBound(mArray)
  Print Format(x, "!@@@@@@");
 Next x
 Print
 
 For x = LBound(mArray) To UBound(mArray)
  Print Format(x * 2, "!@@@@@@");
 Next x
 
End Sub

There's a command button on the form, that's it.

I got this example from a book but it seems flawed. The first line that appears on the form when you click the button are numbers 1 to 15. The numbers on the second line is derived by multiplying the numbers on the first line by 2.

My problem is this: the numbers on the first line and the numbers of the second line should be aligned vertically. As you can see, the first five columns, (i.e. 1 2 3 4 5 on the first line and 2 4 6 8 10 on the second line)
are aligned just fine, but the rest are a mess. How do I align all of them???

Thanks a lot guys!!!

Could you show us the what x is?

Why not add a space every after 1 digit number?

Space won't help the problem though.

It does.. I mean a space character " ". So.. it would look like

Format(x, "!@@@@@@") & " ";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.