Array Definition in vba-excel -


i got in trouble in part of code. have variable changes the number of filled rows.i have defined array 0 number receive "constant expression required" error. thankful if me.

 sub test()    lastrow = cells.find("*", [a1], , , xlbyrows, xlprevious).row    dim f(0 lastrow) double  end sub 

you can't dim array variable, constant

you need dim array before, , redim variable. redim:

sub test()    dim f() double    lastrow = cells.find("*", [a1], , , xlbyrows, xlprevious).row    redim f(0 lastrow) end sub 

with high constant (a bad way)

 sub test()        dim f(35000) double        lastrow = cells.find("*", [a1], , , xlbyrows, xlprevious).row     end sub 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -