Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printing contents of an array into a message box

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Printing contents of an array into a message box

I copied and pasted into the code window. Fixed the line wrap problem and ran
your code.

It worked fine.

Maybe this isn't the same code that failed???

Alex_Rodriguez wrote:

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


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorpoarting cell contents into a message box Colin Hayes Excel Discussion (Misc queries) 6 June 2nd 11 01:50 PM
Printing All the Contents of a Cell Ned Ertel Excel Worksheet Functions 1 November 27th 07 07:39 PM
Printing contents of a listbox Graham Whitehead Excel Programming 1 August 10th 06 02:36 PM
copy and paste and clipboard contents message dr chuck Excel Programming 3 June 25th 06 04:31 PM
Printing with a message Rmagic[_10_] Excel Programming 3 November 20th 05 11:03 PM


All times are GMT +1. The time now is 01:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"