我有輸入數組{{1,4},{1,3},{1,4,7}}得到一個陣列VBA的每個子陣列的長度
Dim array1() As Long
ReDim array1(3, 3)
array1(1, 1) = 1
array1(1, 2) = 4
array1(2, 1) = 1
array1(2, 2) = 3
array1(3, 1) = 1
array1(3, 2) = 4
array1(3, 3) = 7
我想有輸出陣列(其是每個子陣列的長度){2,2,3} 我想使用的for循環如下
Dim i As Long
i = UBound(array1, 1)
Dim outputarray() As Long
ReDim outputarray(i) As Long
For j = 1 To i
outputarray(i) = UBound(array1(i), 2) 'ERROR APPEAR
Next j
我增加Option Base 1
太好了!問題是什麼? – 2014-11-06 04:14:56
我想爲上面的情況生成一個輸出數組{2,2,3}。我想要一個普通的案例。 – useR 2014-11-06 05:54:01