excel - I'm trying to add values into an array through a for each loop -
i'm new vba , i'm trying add values array going through loop, can't seem add values. doesn't throw errors, comes nothing. here's have:
dim long dim results() long redim results(1 6) = 1 = 6 results(i) = 1 next msgbox results(1)
no matter what, message box comes zero. offer appreciated.
your loop written wrong. wrote following
for = 1 = 6
vba interpreting = 6 expression (is equal 6?) expression evaluates false, gets converted integer (zero), attempts execute for = 1 0
, null loop entire loop gets skipped.
it should be
for = 1 6
Comments
Post a Comment