Flow a variant across a union

abielr

New Member
Joined
Mar 9, 2009
Messages
4
I am trying to take a two dimensional array stored in a Variant and have it flow across a union. For instance:

Dim data As Variant
Set data = GetData() ' v is now a 10x2 array of data.

Union(Range("A1:A10"), Range("C1:C10")) = data

In this simple example, the first column of data will appear in the range A1:A10. However, the first column of data will also appears in the range C1:C10; in other words Excel starts at the beginning of the data variable every time it gets to a new range in the union. What I really want is for A1:A10 to contain the first column of data and C1:C10 to contain the second column of data.

Thanks.

Abiel
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,214,788
Messages
6,121,577
Members
449,039
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top