What to download:
All the examples contain all the classes needed for them to work and all projects can be found here.
If you just want the main utility classes used throughout this site, in the downloads section cDataset.xlsm includes everything you need including some examples.
- There can be multiple cDataSet on a worksheet and of course their original spreadsheet locations can physically overlap.
- You can have multiple cDataSets collections if you want.
- The cDataSet deals only in values. No formula manipulation is possible, but each cCell has a record of it’s matching Excel range so you can access that directly.
- In a parameter block the first column is considered the row key, unless you specify a different column my name.
- Duplication of keys (either column or row .. if present) is not allowed. Normally there is only a row key for parameter blocks, but regular datasets can have a unique key as well if you want. Column keys are mandatory since the concept is one of abstracted data.
Traversing a cDataSet
Dim dr As cDataRow, dSets As cDataSets, dc As cCell
Set dSets = New cDataSets
.init wholeSheet("orderstransactions"), , "data", , , True
For Each dc In .Headings
MsgBox ("The value of the heading for " & _
" col " & .Column & _
" is " & .toString & _
" the original address is " & .Where.Address)
Set dSets = Nothing