Redim size of array in VBA Excel -


i have problem use function redim preserve in vba excel.

i redim array use in macro before without clear data inside.

my macro looking :

dim table_data variant ... redim table_data(2 * n + 2 * m + 2 * n, table_case.listcolumns.count - 1) ... dim1 = ubound(table_data, 1) dim2 = ubound(table_data, 2) redim preserve table_data(0 dim1 + 2 * n, 0 dim2) 

do have idea should modify?

when using preserve keyword; can change size last dimension. size of other dimensions once declared must remain unaltered.

the code below should work:

redim preserve table_data(lbound(table_data, 1) ubound(table_data, 1), 0 dim2) 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -