Now that we have seen examples, let’s take a look at each of these in turn. Let’s look at an example Note: Dim and Private do exactly the same thing but the convention is to use Dim in sub/functions and to use Private outside sub/functions.
To create a class module we right-click in the Project window and then select Insert and Class Module Our new class is called Class1. Then, thousands of coffee mugs are created from this design.One is in a class module and one is in a normal module…When you create a variable in a normal module there is only one copy of it.For example Note: We don’t use New with items such as Workbooks and Worksheets. Writing code in a class module is almost the same as writing code in a normal module. It’s how this code is used which is very different. from a class module you must create the object first.Let’s look at the two main differences between the class and normal module. For example, imagine we have two identical Print Customer subs.