0
我手動調換大型數組從記錄集(.transpose沒有工作),但第一列丟失。誰能告訴我哪裏出了錯VBA陣列轉置列丟失
Dim FinalArr As Variant
ReDim FinalArr(1 To UBound(ArrRs1, 2), 1 To UBound(ArrRs1, 1))
For i = 1 To UBound(ArrRs1, 2)
For j = 1 To UBound(ArrRs1, 1)
FinalArr(i, j) = ArrRs1(j, i)
Next
Next
一個下界下界'ArrRs1'零的?如果是這樣,你應該使用'0 To'而不是'1 To'(在聲明和循環中)。 – YowE3K
@ YowE3K那麼看看,我不知道數組可以從0開始。謝謝! – Katie
如果您不確定數組是基於0還是基於1的,請使用'LBound' –