How to isolate macros to one workbook?

percy83

Active Member
Joined
Mar 11, 2009
Messages
278
Hello,

I am just finalizing a dashboard file with some macros in it and I if I have other files open sometimes the worksheet change event triggers (in any other book then the one with macros). How do I isolate my events and macros to a specific file i.e. workbook s that they dont mess with other files I have open?

Could I use somekind of workbook deactivate event ?

How do you all solve these kinds of problems?

Thanks!

Percy
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Maybe like this

Code:
Application.EnableEvents = False
'
'your code
'
Application.EnableEvents = True
 
Upvote 0
Maybe like this

Code:
Application.EnableEvents = False
'
'your code
'
Application.EnableEvents = True

Thanks for your suggestion but I already did above and also put it in a workbook deactivate event to shut off event when another workbook is used simoultaneosly. Somehow a combobox change event is triggered in the macro workbook even if it is not active.

Any suggestions?

BR
Per
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,693
Members
452,938
Latest member
babeneker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top