Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经定义了一个数组,填充了它,并试图在一个等于它的 excel spsh 中设置一个范围。当我使用下面的简单代码(我省略了值分配)时,我在范围的每个单元格中都得到了数组值下标 1。任何人都可以看到有什么问题吗?谢谢。
Dim Loss(1 To 10000) Range("Losses!u11:u10010") = Loss
交替:
Range("Losses!u11:u10010").Value = Application.Transpose(Loss)
Excel 范围始终是二维的
Public Sub foo() Dim Loss(1 To 10000, 1 To 1) For i = 1 To 10000 Loss(i, 1) = i Next Range("Losses!u11:u10010") = Loss End Sub