是否有可能以某种方式将 vba 数组的一部分传递到 excel 范围?
我需要做这样的事情:
dim testday() as Variant
testday = Sheets("raw").Range("E745:BN745").Value
Sheets("raw").Range("E745:BN745").Value = ""
Sheets("Interface").Range("B4:E4") = testday(3, 4, 5, 6).Value
但这不起作用......有没有办法解决这个问题?谢谢!
最佳答案
您可以切片 Array
使用 Index
功能
Sub Slicer()
Dim testday() As Variant
testday = Sheets("raw").Range("E745:BN745").Value
Sheets("raw").Range("E745:BN745").Value = ""
Sheets("Interface").Range("B4:E4")= Application.Index(testday, 1, Array(3, 4, 5, 6))
End Sub
关于excel - 如何将部分 VBA 数组粘贴到 excel 范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25185230/