Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Class module

Hi NG

Just out of curiosity. What is the difference between a module and a class
module.

Regards
Mark


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Class module

A class module is used to define an object, and will have properties and
methods associated with that object defined in there (the attributes of the
object, and the actions that can be performed on/'by it). Using the familiar
example, you might have an employee class, with name, age, sex, grade
properties, and maybe a method to calculate bonus, wage increase, etc. The
properties can be read and/or write.

A module is normally where you would store the common or shared procedures,
ones that may be used even by the class, but do not define a (that) object
themselves.

You use a class like so

Dim myEmp as clsEmployee

Set myEmp = New clsEmployee

with myEmp
.Forename = "Bill"
.Surname = "Wallis"
.DOB = "12 Jun 1976"
.Sex = "M"
.AddLine1 = "37 Acacia Avenue"
'etc
End With

You now have an instance of an employee with many details that you can
access directly. YOu could then put that employee into another class, a
collection class of employees ... but too much too soon perhaps.

By the way, userforms and worksheet code modules are also special calls
modules, defining the form or the worksheet they are associated with.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mark" wrote in message
...
Hi NG

Just out of curiosity. What is the difference between a module and a class
module.

Regards
Mark




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Class module

Search google on the subject:

http://www.google.com/groups?as_q=cl...e=off&ie=UTF-8
&oe=UTF-8&as_ugroup=*excel*&as_uauthors=pearson&lr=&num=20 &hl=en

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , says...
Hi NG

Just out of curiosity. What is the difference between a module and a class
module.

Regards
Mark



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating UDF by Class Module (Leo)? Leo Excel Discussion (Misc queries) 1 December 2nd 08 10:59 AM
CLASS MODULE & SIMPLE MODULE FARAZ QURESHI Excel Discussion (Misc queries) 1 September 7th 07 09:32 AM
Class Module Scope Trent Argante[_2_] Excel Programming 2 January 6th 04 03:01 PM
Class module David Excel Programming 4 December 31st 03 01:58 PM
Variable from a sheet module in a class module in XL XP hglamy[_2_] Excel Programming 2 October 14th 03 05:48 PM


All times are GMT +1. The time now is 12:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"