P
Phillip M. Feldman
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
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