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

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,190,635
Messages
5,982,050
Members
439,751
Latest member
sohamkhatri

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
Top