Home All Groups Group Topic Archive Search About

printing contents of an array into a message box

Author
12 Nov 2007 11:48 PM
Alex_Rodriguez
Hi,

Currently, I am working through some basic examples given on this
website: http://www.anthony-vba.kefra.com/index_011.htm. When I tried
the first example in Excel VBA Basic Tutorial 3, ie:

        Option Base 1
            Sub assignArray( )
                  Dim Arr(5)

                  Arr(1) = "Jan"
                  Arr(2) = "Feb"
                       Arr(3) = "Mar"
                       Arr(4) = "Apr"
                  Arr(5) = "May"

                  Msgbox Arr(1) & "-" & Arr(2) & "-" & Arr(3) & "-" &
Arr(4) & "-" & Arr(5)
            End Sub

I ended up with:   ----   in the message box, rather than:   Jan-Feb-
Mar-Apr-May

What do I need to do in order to correct this?

Cheers,

Alex

Author
12 Nov 2007 11:58 PM
Bob Butler
"Alex_Rodriguez" <a***@elggodo.net> wrote in message
news:1194911334.911329.209010@s15g2000prm.googlegroups.com...
> Hi,
>
> Currently, I am working through some basic examples given on this
> website: http://www.anthony-vba.kefra.com/index_011.htm. When I tried
> the first example in Excel VBA Basic Tutorial 3, ie:

is that the actual code copied & pasted?  If so, it runs fine for me.

You should probably re-post your question in a newsgroup for Excel.VBA
though since VBA and VB aren't quite the same thing
Author
17 Nov 2007 2:15 AM
Alex_Rodriguez
Show quote
On Nov 13, 10:58 am, "Bob Butler" <no...@nospam.ever> wrote:
> "Alex_Rodriguez" <a***@elggodo.net> wrote in message
>
> news:1194911334.911329.209010@s15g2000prm.googlegroups.com...
>
> > Hi,
>
> > Currently, I am working through some basic examples given on this
> > website:http://www.anthony-vba.kefra.com/index_011.htm. When I tried
> > the first example in Excel VBA Basic Tutorial 3, ie:
>
> is that the actual code copied & pasted?  If so, it runs fine for me.
>
> You should probably re-post your question in a newsgroup for Excel.VBA
> though since VBA and VB aren't quite the same thing

Ok, thanks.

AddThis Social Bookmark Button