本文介绍了仅在Excel中的几列中打开/关闭自动计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在excel中,我有一个超过30,000行的工作表。下图显示了样本数据。每当我更新单元格时,大约有十二列的公式会真正减慢工作速度。我想使用VBA代码关闭仅5列的自动公式计算(请参见示例中的红色列)。黄色栏中的公式将一直运行。然后,我想创建一个宏,该宏在每次按下时都会在红色列中计算公式。

In excel I have a worksheet with over 30,000 rows. Sample data is shown in the image below. About a dozen of the columns have formulas which really slow down the work whenever I update a cell. I would like to use VBA code to turn off automatic formula calculation for only 5 columns (see columns in red in example). The formulas in the columns in yellow would run all the time. I would then like to create a macro that calculates the formula in the red columns whenever pressed.

我尝试在功能区中寻找一些选项,但没有成功。

I tried looking for some options in the formula ribbon but wasn't successful.

推荐答案

如果要创建宏

Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculateManual

[YOUR CODE HERE]

Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
Application.EnableEvents = True

但是,如果您只想启用和禁用。.从功能区转到菜单 公式/计算选项 ,然后选择或手动

But if you just want to enable and disable.. Go to the menu (from the ribbon) Formulas / Calculation Options and select Automatic or Manual as desired.

这篇关于仅在Excel中的几列中打开/关闭自动计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 22:44