vba - I am getting out of script error, why? -
here code
sub logic() 'declaring variables dim r long, long, k long, l long dim num() long dim del() long 'assigning values r = 2 = 0 k = 0 l = 0 redim num(0) redim del(0) until cells(r, 11).value = "" num(i) = cells(r, 15).value 'i m getting error on here del(l) = k - num(i) k = num(i) = + 1 redim preserve num(i) 'preserve value r = r + 1 l = l + 1 loop r = 2 l = 0 ubound(num) - 1 cells(r, 25).value = del(l) r = r + 1 next l end sub
you growing num
array forget same del
array. believe need modify code this:
i = + 1 redim preserve num(i) 'preserve value r = r + 1 l = l + 1 redim preserve del(l) ' add line
Comments
Post a Comment