View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Restrict Worksheet_Calculate() to its original worksheet !!!

Carim,

Add this to the top of your event code:
Application.EnableEvents = False

And this to the bottom:
Application.EnableEvents = True

Of course, that may prevent the auto_open macro or the workbook_open event
of the workbook that you are opening from running, so there will be some
further testing on your part involved.

HTH,
Bernie
MS Excel MVP

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

I have to use worksheet calculate to fire a couple of macros.
The problem is that, at a later stage, another workbook is opened, and
worksheet_calculate() fires automatically in the newly opened workbook.
So far, I had no success in adding a trap such as :
If ActiveSheet.Name <"xxxx" Then exit sub ...
Any suggestions ???
Thanks in advance
Carim