Series Overview: Tips and Tricks with VBA Classes

In their simplest form, VBA classes can create basic objects. By diving into advanced concepts, classes introduce some common features present in traditional object oriented programming languages. Overview This is the fourteenth and final post of the Tips and Tricks with VBA Classes series. This post acts as a summary …

Using Methods and Properties within a Collection Class

The VBA collection class provides a framework to support basic object structures. While its most common use a collection class to manage groups of custom objects, including new properties and methods permits extraction of key aggregate data points for the entire collection. Overview This is the eight post in the …

Forcing Class Properties to do More Work

Class properties are typically simple statements which serve the basic purpose of reading or writing data in custom objects. However, it is possible to add additional lines of code, giving properties features similar to standard subroutines or functions.

Storing Multiple Object Collections in a Collection Class

While VBA collection classes are best known for storing collections of single custom object types, they can also be built into much more complex data structures. This includes storing multiple object collections within a single collection class, permitting a node-like structure to store any number of related items.

Creating a Collection Class within a Collection Class

A common object structure in VBA is the collection class, where many custom objects are grouped together. VBA also permits additional layers above the collection class, resulting in a collection within a collection. This is a useful technique for organizing hierarchical data or grouping certain objects.

Sorting Objects of a Collection Class

One feature noticeably absent from VBA is a built-in function to sort arrays and collections. The bubble sort is a well known technique for sorting groups of elements when no native function exists. With a few minor adjustments, a bubble sort can also be used to sort collections of custom …

Using Class Initialize in Collection Classes

Class Initialize is known as an intrinsic (native) procedure that triggers when a custom object is initialized. Did you know that this procedure will also work within collection classes? When used properly, class initialize can help set up collections by using default data or loading from saved data.