Microsoft Office Tutorials and References
In Depth Information
Practical Class Design
Now that you know what a class is and the mechanics of building one, it’s worth briefly cov­
ering some practical tips for building classes.
A Simple Class
It’s quite reasonable to create a class that simply contains only properties and no methods.
(See Figure 14-2.)
Figure 14-2. You can easily build a simple class in the Visual Basic Editor.
You can create this class by following these steps:
1
Select Insert, Class Module from the VBA main menu.
2
Select the new class in the Project Explorer, and change the Name property in the
Properties window to Plant.
3
Enter the following statements into the Edit Window:
Public CommonName As String
Public ScientificName As String
Public Description As String
Public RetailPrice As Currency
Public WholesaleCost As Currency
Public ProductNumber As Long
Search JabSto ::




Custom Search