我正在尝试对具有多个列的数组进行Redim:
Dim f() as Variant
ReDim f(0 To 0, 0 To 0) As Variant
ReDim Preserve f(0 To UBound(f), 0 To UBound(f))
要获得类似的内容:
[15 34 70]
[当我尝试存储到数组中时,我正在这样做:
f(0,i) = ...
f(1,i) = ...
f(2,i) = ...
代码有什么问题?
我想创建一个具有1行3列的数组,其中列数可能会增加。首先,我需要重新定义空数组(Dim f() As Variant
)的尺寸,如下所示(ReDim f(0 To a, 0 To 3)
)。上面的代码无法正常工作,因为我试图重新设置已经确定尺寸的数组。
第二,我希望数组返回:
f(0,i) = "Bring the value from, for instance, cells A9"
f(0,i+1) = "Bring the value from, for instance, cells A16"
f(0,i+2) = "Bring the value from, for instance, cells G16"