View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default different places to put excel code?

I'll try.
sheet specific macros such as worksheet_change must be in the sheet module.
UDF (User defined functions) must be in a regular MODULE
workbook_open and others must be in the ThisWorkbook module
Regular old macros can often be anywhere as long as properly referenced.
HTH
--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Ross" wrote in message
om...
hi there,

could someone tell me the difference between putting a sub in a
worksheet specific code module and a general module?

When I hope my spreadsheet, then do alt-f11, I see Sheet1 with a place
for code, as well as a Module1 that takes code. Sometimes I find that
if I am trying to call a procedure from within Sheet1 code, it won't
find it unless I put the called procedure in the Module1.

I know this must be very basic stuff for Excel. A brief explanation
would be appreciated!

Thanks
Ross