syntax error - Arrays in excel vba -


programming macro in excel 2010 doing syntactically causing error?

error message says:

compile error: expected: end of statement

code:

dim myarray = new string() {"a",  "b",  "c", ... continues to..."z" }  

looks using other language construct, try (assumes know in advance how long array needs be, , know in advance values assign array:

dim myarray() string  myarray = split("a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z", ",") 

if don't know values in advance, approach might need different using iteration/etc.

note: arrays typically base 0 in vba, example makes base 1.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -