简体   繁体   English

Excel VBA动态数组大小

[英]excel VBA dynamic size of array-array

I simply have the issue that I need to create an array with a number of arrays. 我只是有一个问题,我需要用多个数组创建一个数组。 the problem is that the number of the arrays are only known at runtime. 问题在于仅在运行时才知道数组的数量。 so, how can initialize (create) the array with the correct size? 因此,如何初始化(创建)具有正确大小的数组?

Thanks a lot! 非常感谢!

As per Ron's comment, use variables to set your array when it is known. 根据Ron的评论,在知道数组时使用变量来设置数组。

Dim lngRow As Long
Dim lngCol As Long
Dim X()
lngRow = 100
lngCol = 15
ReDim X(1 To lngCol, 1 To lngRow)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM