Found the answer on msdn in C# and VBA: http://blogs.msdn.com/b/eric_carter/archive/2004/05/04/126190.aspx
Write an array to a non-contiguous range of cells
-
07-10-2022 - |
Domanda
I would like to write data to a non-contiguous selection in Excel which looks like this:
I tried to write a 2d array to that range but it doesn't seem to work:
Dim arr()
ReDim arr(1 To 1, 1 To 5)
arr(1, 1) = 1
arr(1, 3) = 3
arr(1, 5) = 5
Dim r As Range
Set r = Range("A1,A3,A5")
r.Value = arr
Any ideas where I'm going wrong?
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow