redimension multidimensional arrays in Excel VBA

后端 未结 4 1156
难免孤独
难免孤独 2021-01-28 02:59

Take a look at the following code. What my problem is is that I can\'t figure out how to redimension the n integer and the b integer. What I\'m doing is the array sent1 is alr

4条回答
  •  情歌与酒
    2021-01-28 03:43

    The problem that you have is that you cannot change the rank (dimensions) of an array with a redim statement.

    dim sent() creates a 1-rank array, redim sent2(x, y) assumes a 2-rank array. Try dim sent(,).

    Also, it will improve performance (and code robustness) if you use

    dim sent1() as string
    dim sent2(,) as string
    

提交回复
热议问题