For loop Vba with 2 variable -
arrayone(1) = arraytwo(1) = b
arrayone(2) = c arraytwo(2) = d
arrayone(3) = e arraytwo(3) = f
i need loop through 2 arrays call sub. note sub called in pair, e.g.:
sub(arrayone(1), arraytwo(1))
sub(arrayone(2), arraytwo(2))
is possible initialize 2 variables? that:
for x = lbound(arrayone) ubound(arrayone) , y = lbound(arraytwo) ubound(arraytwo) call sub(x, y) next x
thanks
one for next
loop cannot use 2 indexers
if sure arrays same size, can use same indexer both arrays
dim integer = lbound(arrayone) ubound(arrayone) call sub(arrayone(i), arraytwo(i)) next
Comments
Post a Comment