How do you get the last number of a array?
so I could do this
Dim Array() as string
Dim lastnum as integer
lastnum = lstarr(array())
debug.print array(lastnum)
and it would print the last string
in the array
Thanks!
Printable View
How do you get the last number of a array?
so I could do this
Dim Array() as string
Dim lastnum as integer
lastnum = lstarr(array())
debug.print array(lastnum)
and it would print the last string
in the array
Thanks!
Use Debug.Print theArray(UBound(theArray))
That should do it.
Lowest is LBound
Highest is UBound
Code:Dim myArray(4)
For i = 1 To 4
myArray(i) = i
Next i
MsgBox myArray(UBound(myArray))