LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Assembling large "array"

I am using Excel 2003 on Windows Vista

I have a file of London fare data. (Shows fares between origin and
destination stations.)
It consists of about 600 rows and columns.
Because Excel 2003 only supports 256 columns in a sheet, I need to split
my data over more than one sheet.

The data ought to be symmetrical and mostly is. However, I have found
one pair of stations where the AB price and BA price are different.
It takes several elapsed days to assemble that file from the Internet.
I would like to identify asymmetric data to assess the extent of that
asymmetry. i.e. I assume AB price = BA price is probably correct.

I want to assemble an "array" in memory.
I can read data from a single sheet with code like this:
Dim PricesA_D As Variant
PricesA_D = Sheets("A-D").Range("B2", _
Sheets("A-D").Cells.SpecialCells(xlCellTypeLastCell).Address )
' The first row and column contain station names

I think I need a picture.
Sheets("A-D") might start
Abbey Wood Acton Central Acton Main Line ...
Abbey Wood X 1.23 2.34
Acton Central 3.21 X 3.45
Acton Main Line 2.34 3.45 X
....

I have shown asymmetric data between Abbey Wood and Acton Central.

Sheets("E-K") station names might start
Ealing Broadway Ealing Common Earls Court ...
Abbey Wood
Acton Central
Acton Main Line
....

I want an "array" in which the E-K data is appended to the A-D data.

I tried
Dim Prices As Variant
Prices = Application.Union( _
Sheets("A-D").Range(
"B2", _
Sheets("A-D").Cells.SpecialCells(xlCellTypeLastCell).Address ), _
Sheets("E-K").Range(
"B2",
Sheets("E-K").Cells.SpecialCells(xlCellTypeLastCell).Address ), _
Sheets("L-R").Range(
"B2",
Sheets("L-R").Cells.SpecialCells(xlCellTypeLastCell).Address ), _
Sheets("S-Z").Range(
"B2",
Sheets("S-Z").Cells.SpecialCells(xlCellTypeLastCell).Address ))

I got Run-time error '1004':
Method 'Union' of object '_Application' failed

I assumed that was because Union tries to create a sheet with more than
256 columns.

To test that assumption, I tried
Prices = Application.Union( _
Sheets("A-D").Range("B2", "T20"), _
Sheets("E-K").Range("B2", "T20"))
but got the same error.

1) Why does Union get 1004?
2) How do I construct a large "array" with minimal coding?
3) After
Dim PricesA_D As Variant
PricesA_D = Sheets("A-D").Range( _
"B2", _
Sheets("A-D").Cells.SpecialCells(xlCellTypeLastCell).Address )
Locals shows StationsA_D has Type Variant/Variant(1 to 623, 1 to 151)
What code will find those values 623 and 151 in StationsA_D?

My original problem of finding asymmetric data can easily be solved by
comparing cells on my 4 sheets.
I want to be able to process copies of sheet data in memory.
--
Walter Briscoe
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help using the LARGE function "WITHOUT" using an array exceluser Excel Worksheet Functions 6 June 5th 10 11:17 PM
Using the functions "LARGE"and "SMALL" in an Excel program Ed[_30_] Excel Programming 0 March 18th 08 05:14 PM
Listbox header inside VBA (Array("Head1", "Head2", ...) Alex St-Pierre Excel Programming 2 October 25th 06 09:28 PM
If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ... Maria J-son[_2_] Excel Programming 2 March 5th 06 12:20 PM
Utility to "clean up" or "defrag" large Excel file Sabrina Excel Discussion (Misc queries) 3 January 12th 06 09:57 PM


All times are GMT +1. The time now is 06:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"