O
Otto Moehrbach
Excel 2002, WinXP
The MsgBox in this simple macro produces Two, Three in turn. It skips the
One.
But if I change the "1" in the For statement to a "0", I get One, Two,
Three.
Why does this happen?
Thanks for your help. Otto
Public TheArray() As Variant
Dim c As Long
Sub MacroOne()
ReDim TheArray(1 To 3)
TheArray = Array("One", "Two", "Three")
For c = 1 To UBound(TheArray)
MsgBox TheArray(c)
Next
End Sub
The MsgBox in this simple macro produces Two, Three in turn. It skips the
One.
But if I change the "1" in the For statement to a "0", I get One, Two,
Three.
Why does this happen?
Thanks for your help. Otto
Public TheArray() As Variant
Dim c As Long
Sub MacroOne()
ReDim TheArray(1 To 3)
TheArray = Array("One", "Two", "Three")
For c = 1 To UBound(TheArray)
MsgBox TheArray(c)
Next
End Sub