Question

I would like to write data to a non-contiguous selection in Excel which looks like this:

enter image description here

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?

Was it helpful?

Solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top