我在VBA中有兩個函數。 Function1返回一維數組。然後我有一個多維數組function2。我想將Function1中的數組複製到從索引1開始的多維數組的列中。複製一維數組到多維數組 - VBA
arr2(0,0) = "Something"
arr2(0,1) = ("Something",arr1(0))
arr2(0,2) = ("Something",arr1(1))
這就是我所擁有的。 arr1是GetRecData,arr2是AllChannelsData。
For i = 0 To UBound(channelList)
'the first row in the array is the channels names
AllChannelsData(i, 0) = channelList(i)
Set RecChannel = Rec.FindChannel(channelList(i), RecDevice.Name)
For j = 0 To total_time
AllChannelsData(i, j + 1) = RecChannelData.GetRecData(RecChannel, 1, 0)
Next
Next
謝謝!
感謝您的快速回復。第三個參數不是索引。 GetRecData方法需要三個參數來返回一維數組。 – peetman