Classes are one of the most powerful features in VBA. While VBA is not a true object oriented programming language, the OOP-like features it offers make the language very robust. When used in conjunction with the Excel application, classes open up endless opportunities for dashboards, reports, and other Excel projects.
This series focuses on some of the lesser known tips and tricks associated with VBA classes. The content of this series assumes you are familiar with classes and objects in VBA. If you are familiar with VBA, but have not yet learned about classes, I suggest you view the last part of our Getting Started with VBA series.
Topics within these posts focus on coding techniques and subjects that I’ve learned after years working with classes. This includes borrowing concepts from other languages, such as C++ or VB.NET and applying them to VBA. In some instances, I’ve figured out techniques to mimic features from more robust languages. In other cases, it involves leaving the comfort zone of standard practices in VBA.
For continuity, this series focuses on a general theme of storing country demographics and details in classes and collection classes.
- Using Custom Keys in Collection Classes
- Saving Custom Object Data in a Workbook
- Using Class Initialize in Collection Classes
- Sorting Objects of a Collection Class
Complex Class Structures
- Creating a Collection Class within a Collection Class
- Storing Multiple Object Collections in a Collection Class
Advanced Concepts with Class Properties
- Forcing Class Properties to do More Work
- Using Methods and Properties within a Collection Class
- Storing Arrays as Class Properties
- Storing Objects as Class Properties
- VBA Inheritance: Custom Objects as Class Properties
- VBA Interfaces: The Implements Statement