View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
merjet merjet is offline
external usenet poster
 
Posts: 812
Default Assembling large "array"

1. A Range is a class *within* another class, Worksheet. You can use
Union to combine two Ranges, both from the same Worksheet, but you
can't make one Range from two different Worksheets.
2. Since Prices is a Range, you should have used Set Prices = ...
3. I think you will have to settle for creating an array that is not a
Range, e.g. as follows.

Dim dArr(1 To 3, 1 To 6) As Double
Dim iRow As Integer
Dim iCol As Integer
For iRow = 1 To 3
For iCol = 1 To 3
dArr(iRow, iCol) = Sheets("A-D").Cells(1 + iRow, 1 +
iCol).Value
Next iCol
For iCol = 4 To 6
dArr(iRow, iCol) = Sheets("E-K").Cells(1 + iRow, iCol -
2).Value
Next iCol
Next iRow

For this I changed your X's to 0's. If you want to use X's, declare
dArr as Variant.