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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,214,905
Messages
6,122,172
Members
449,071
Latest member
cdnMech

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