看板 Programming 關於我們 聯絡資訊
大家好 我有一個VBA 宣告二維陣列問題 我程式碼如下 Dim a() as Variant A = 10 B = 20 Redim a(A, B) as Variant 當我要存取a這個二維陣列時,例如 a(0,0) = 10 每次都會跑出 Subscript out of range 但我應該有正確宣告二維陣列 想請教各位我宣告上面出了什麼問題嗎? 謝謝各位 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.194.219.94
MOONRAKER:無法重製你的錯誤,請檢查有沒有在哪裡 118.163.12.174 07/19 16:02
MOONRAKER:使用option base敘述 118.163.12.174 07/19 16:02
yauhh:"Subscript out of range"中文就是陣列超出 36.226.96.9 07/19 21:46
yauhh:索引範圍. 你可以用UBound,LBound函數來查 36.226.96.9 07/19 21:46
yauhh:陣列邊界. 36.226.96.9 07/19 21:46