Excel VBA Macro Programming

Select Insert Class Module from the code menu to create a class module called Class1. You need to change the name immediately, because this will be the name of the object that you create, and Class1 is somewhat meaningless because it does not reflect the functionality of that class. You use this name within your code to refer to the object and it will become tedious if you keep referring to Class1.

You change the name in the properties window; class modules only have one property, the name. Select the name field and overtype it with PName . This represents the individual objects within a collection. Double-click the class module within the tree view to display it.

Категории