Arrays or Collections for data manipulation?

kdr1066

New Member
Joined
Jan 3, 2012
Messages
5
Hi,

I have developed a workbook for estimating project costs based on selected Labour, Material, and Plant components, but I've recently dicovered classes and collections and was wondering whether they could be used to develop a more efficient solution.

The data is multi-dimensional, i.e. Components are grouped into Units, which in turn are grouped into Templates. The costs are driven by the Type of Work and the Geographical Area it will be done.

The current solution simply lists all the components on a worksheet in a Unit/Component hierarchy, with the available costs for each component held on separate worksheets. The user selects Units (or a predefined selection by picking a Template) and copies them into another worksheet to calculate the estimate. Cost data is copied into the estimate from the cost sheets based on the work type and area, i.e. the applicable contractor rates.

The solution works, but is slow and means each user copy of the workbook stores the full dataset, which is pushing 10Mb. I'm sure there must be a more efficient approach, hence looking at classes etc...

Could/should I create a Class to hold the Components, possibly in a single workbook that sits centrally, and then load the data into an array or collection in another workbook each time a user wants to create an estimate? From the limited experience I have with classes, getting data in and out is much quicker than filtering/copying from one sheet to another.

Your advice would be appreciated.

Thanks in advance.
 
Hi Fazza,

I decided to keep all the source data on a single worksheet for now, as all but one of the tables are relatively small. I've managed to do some basic testing of the tables created and loaded with data so far, e.g. select and a few joins, just to see if I can retrieve the data from multiple tables, which I can, so I'm currently rationalising the source data, before creating/loading the remaining tables.

Regarding my second question, it came from what I had seen so far, just a single table when I opened the mdb in Excel. I've managed to create/load a few more tables since, so now I get a choice of tables to view when I open the file now. I presume the list will also include queries, assuming I manage to create some?

Thanks again for your help and reassurance that I'm going in the right direction. I'm reasonably confident that I can get the rest done, it's just another steep learning curve for a non-techie newbie :rolleyes:
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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