ฉันกำลังพยายามพิมพ์อาร์เรย์ที่สร้าง VBA ลงในเซลล์ของสเปรดชีต Excel ค่าการซึมผ่านและน้ำไหลบ่าได้รับข้อผิดพลาด "ตัวห้อยอยู่นอกช่วง" อย่างต่อเนื่อง ฉันกำลังสร้างอาร์เรย์ท่ออย่างถูกต้องหรือไม่ ฉันได้รวมฟังก์ชันย่อยการคำนวณและการพิมพ์เข้าด้วยกันแล้ว
NumMonth = 12
Dim col As Long
Dim rw As Long
rw = 4
col = 13
Range(Cells(rw, col), Cells(rw + NumMonth - 1, col)).Value = _
Application.Transpose(WC)
Range(Cells(rw, col + 1), Cells(rw + NumMonth - 1, col + 1)).Value = _
Application.Transpose(Runoff)
Range(Cells(rw, col + 2), Cells(rw + NumMonth - 1, col + 2)).Value = _
Application.Transpose(Percolation)
End Sub