View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Phillip M. Feldman Phillip M. Feldman is offline
external usenet poster
 
Posts: 6
Default code works on some computers, but not on others

The following simple program is supposed to display one message box
containing the string "Jan", and a second one containing six month names
separated by dashes. At least one person reports getting this result from the
code, but when I run it on my two laptop computers, the first message box is
empty, and the second contains only the five dashes (no month names). All of
these are Windows XP PCs running Excel 2003. Any suggestions as to why this
is happening will be greatly appreciated.

Option Base 1
Dim Arr() As String

Sub assignArray()
ReDim Arr(5)

Arr(1) = €œJan€
Arr(2) = €œFeb€
Arr(3) = €œMar€
Arr(4) = €œApr€
Arr(5) = €œMay€

MsgBox Arr(1)

ReDim Preserve Arr(6)

Arr(6) = €œJun€

MsgBox Arr(1) + "-" + Arr(2) + "-" + Arr(3) + "-" + Arr(4) + "-" + Arr(5)
+ "-" + Arr(6)
End Sub