View Single Post
  #16   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default SheetActivate/DeActivate events in a common module

I've not heard the term 'dynamic template' before and not sure what that
implies in your context. However, as I've tried to explain, when you copy a
sheet into another wb only the sheet and its sheet module code will be
copied.

To be clear - no other module will be copied with the sheet, the events in
the copied sheet module can only trap events in the copied sheet.

In theory, the activate event in the copied sheet could check if it it's not
the only sheet in the wb, if so check a 'flag' in some cell, if that doesn't
exist it must be a recently copied sheet. Then go on to write event code in
the ThisWorkbook module as described before, and set a flag to avoid doing
same again. But don't go there!

Regards,
Peter T


"Dileep Chandran" wrote in message
ups.com...
Hi Peter,

I am looking for an alternative for this:

Why not install the event code directly into Thisworkbook.module of
the 30+
sheet wb, in a template perhaps.

Because our templates are dynamic.

-DC