Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi ,
Can someone please explain in laymen's terms the difference between the two? The advantage of a class module over a module ? Is there any special requirements that a class module needs over a module? Thanks for your help. Jeff |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Although class modules aren't discussed extensively, this may provide what
you need to know: From Chip Pearson's site: http://www.cpearson.com/excel/codemods.htm where to put your code -- Regards, Tom Ogilvy Jeff Marshall wrote in message ... Hi , Can someone please explain in laymen's terms the difference between the two? The advantage of a class module over a module ? Is there any special requirements that a class module needs over a module? Thanks for your help. Jeff |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jeff,
The short answer is that if you have to ask the difference between modules and class modules, don't use class modules. Put all your code in standard modules. The longer answer is that you use class modules to create your own objects. Objects are defined by their properties, methods, and events -- all of which are placed in the class module -- and then defined in to existence with the Set New syntax. If you are familiar with Type variables (called Structures or Structs in other programming languages), you can think of a class as a "Type With Code". You use Property Let/Get/Set statements to define the properties (variables) of the class, and then add code with Subs and Functions. Once you've defined all the properties and methods in the class module, you create an object variable (or "instance") of that class with code like Dim X As Class1 Set X = New Class1 A full discussion of how (and when) to use classes is beyond the scope of a newsgroup post. A good book on VBA should provide at least the basics. -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com "Jeff Marshall" wrote in message ... Hi , Can someone please explain in laymen's terms the difference between the two? The advantage of a class module over a module ? Is there any special requirements that a class module needs over a module? Thanks for your help. Jeff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VB Modules | Excel Discussion (Misc queries) | |||
Help with modules. | New Users to Excel | |||
Naming class modules in Excel 2002 | Excel Discussion (Misc queries) | |||
Class Modules | Excel Programming | |||
Event - RaiseEvents Within Class Modules | Excel Programming |