Array only populated in last index?
I have array Dim Timer(2)
I loop through a do while loop three times and each loop I set Timer(2) =value
After I exit the loop
msgbox(Timer(0)) is empty
msgbox(Timer(1)) is empty
msgbox(Timer(2)) has the correct value
Why does the array only have data in the last index?
Thanks in advance
Because you are only setting the last index. Timer(2)=value just means set the 3rd position in the array.
Sounds like you could use a for loop
for i = 0 to 2
you are doing mistake here Timer(2) =value.
Because you are setting value at index 2 and not setting values to 0 and 1 index, they are empty.
Here are the two ways of working with Arrays:
For i=0 to ubound(arr)
For i=0 to ubound(arr1)
I totally forgot about indexing the array...