+ Reply to Thread
Results 1 to 3 of 3

Displaying an array as columns in a msgbox

  1. #1
    Registered User
    Join Date
    10-13-2004
    Posts
    26

    Question Displaying an array as columns in a msgbox

    Hello all, I was looking around on how to create columns in a message box to display the contents of an array, but all I found was how to get them into a list box. I'm EXTREMELY close on this one.

    This code creates an array of integers from 1 to 39, then displays them in a 3 x 13 grid in a message box, i.e.:

    1 2 3
    4 5 6
    7 8 9

    and so forth. The problem I'm having is that it won't output anything after "1" in the first column, i.e.:

    1 2 3
    5 6
    8 9
    11 12
    14 15

    Here's my code:

    Please Login or Register  to view this content.
    Using t = a(i1 + 3) nets me one column of 4's. If I refer to the array directly, as in:

    t = a(i1) & vbTab & a(i2) & vbTab & a(i3) & vbCrLf

    t = a(i1 + 3)...

    Then t only retains the last 3 numbers (37, 38, 39) and displays that in the message box. I may be wrong, but I feel that this can be done. Anyone have any different ideas? Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    A couple of ways

    Please Login or Register  to view this content.

    rylo

  3. #3
    Registered User
    Join Date
    10-13-2004
    Posts
    26
    Heh, ingenious. Never thought of just using a blank string variable. Thanks rylo!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1