View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
chad chad is offline
external usenet poster
 
Posts: 273
Default Union method for Range Object

I am attempting to fill an array with a non-contiguous range. I have figured
out several ways to do this but each has its limitations. Using the
following, the range object created has a single column (even though the
reference includes multiple columns).

Dim X_in As Range, X As Variant, i, j

Set X_in = Application.Range(Sheet1!$A$1:$A$6,Sheet1!$C$1:$D$ 6)

X = X_in

For j = 1 To UBound(X, 2)
For i = 1 To UBound(X, 1)
Cells(i, j + 10) = X(i, j)
Next i
Next j


I have tried the Union method, areas, etc.

Thanks,

Chad