停止运行“worksheet_change”或worksheet_calculate [英] Stop a 'worksheet_change' or worksheet_calculate from running

查看:311
本文介绍了停止运行“worksheet_change”或worksheet_calculate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一份载有代码的工作表。该代码中有worksheet_change和worksheet_calculate功能。在某些程序中,此代码有时会在此工作表上运行时不必要地运行。是否有一行代码可以防止运行worksheet_change或者workheet_calculate宏?

解决方案

是的,只需设置 Application.EnableEvents

code> FALSE。



处理完成后,请勿忘记将其重新开启。


I have a worksheet heavily laden with code. There are 'worksheet_change' and 'worksheet_calculate' functions amongst that code. during certain procedures this code runs unnecessarily sometimes when working on this sheet. Is there a line of code that would prevent running the 'worksheet_change' or worksheet_calculate macros? Kind of a "don't call"?

解决方案

Yes, just set Application.EnableEvents to FALSE.

Don't forget to turn it ON back after your processing is completed.

这篇关于停止运行“worksheet_change”或worksheet_calculate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆