Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Difference among Module, SheetX, ThisWorkbook?

Hi,

Have been using VBA for a while but I only write code in modules,
wondering what's the difference among them.

Is code in Sheet1 only effective for sheet 1 or is it Worksheet level
function, etc.?

Thanks,

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Difference among Module, SheetX, ThisWorkbook?

Code in worksheet1 tends to be event code that is driven by events on that
sheet. You can add other code, but in general, it would only be for code
associated with those events.

Similarly, Thisworkbook handles workbook events.

Standard modules tend to be where you would create the more general code, or
even code that might be accessed by some event on more than one worksheet.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"muster" wrote in message
oups.com...
Hi,

Have been using VBA for a while but I only write code in modules,
wondering what's the difference among them.

Is code in Sheet1 only effective for sheet 1 or is it Worksheet level
function, etc.?

Thanks,



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
Workbook_Open in ThisWorkbook.module Bob Barnes Excel Discussion (Misc queries) 1 February 12th 08 07:52 PM
Can I add code to ThisWorkbook module with VBA extensibility? mikeb Excel Programming 3 May 9th 06 11:35 PM
Calls from sheet module to ThisWorkbook module quartz[_2_] Excel Programming 2 June 23rd 05 03:37 PM
How to use: ThisWorkbook module RichardG Excel Programming 2 October 21st 04 12:44 AM
ThisWorkbook module question Stuart[_5_] Excel Programming 3 July 17th 04 02:32 PM


All times are GMT +1. The time now is 04: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"