I'm losing quite some time copy-pasting identical properties and methods in various vba custom object I'm building. How do I create an custom-object hierarchy in VBA so one object and inherit properties and methods from others.
In python I would prob write something like:
Class Car(Object)
whatever
Class SlowCar(Car)
inherit whatever
Class FastCar(Car)
inherit whatever
tks in advance.
If i understand what you're saying, this can be done via the Class Module.
Car
for example) via the Properties Window (press F4 to make it appear if it does not already)Now that you've created your class module you can define its variables and/or properties. The example below would go into your
Car
Class Module creates a object that holds a car name and a speedThen from your Module, you can do the following