View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Jamie Collins Jamie Collins is offline
external usenet poster
 
Posts: 593
Default Macro, Module, function, sub and This workbook and sheets ?

"Frank Kabel" wrote ...

ThisWorkbook and the worksheet modules are used for event procedures.
See:
http://www.mvps.org/dmcritchie/excel/event.htm
http://www.cpearson.com/excel/events.htm


They may also be used for custom workbook- and worksheet-level
properties and methods. I know Chip and others prefer to reserve them
for events but for me they better fit the OOP approach. I never use
public variables so a public property in the ThisWorkbook is useful
for implementing a global. And I will only put code in a standard
module if there is no alternative e.g. need to call a procedure using
its address in memory.

Jamie

--