arrays - For loop to last value in matrix -


i looping down each row in array, , array variable size 76 or columns , 1000 rows. but, matrix not full, , rows not fill 1,000. however, need keep matrix size, may grow in future. syntax going until hit last element in array? stuck with. thanks

do while <= 1000 

you want loop until array value isempty().

option base 0 dim long dim myarray(75, 999)  while not isempty(myarray(i, 0))     = + 1 loop 

or

option base 1 dim long dim myarray(76, 1000) = 1 while not isempty(myarray(i, 0))    = + 1 loop 

shai rado correct should use dynamic array. excel vba array tutorial


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -