我正在尝试将 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