简体   繁体   English

Excel 即使更改单个单元格也刷新整个工作表

[英]Excel Refreshes whole sheet even when a single cell is changed

I am working on an Excel Add-in and have created some custom functions in it.我正在处理 Excel 加载项,并在其中创建了一些自定义函数。 Now my user has created some functions (150+ custom functions) and all of these custom functions have parameters as references to other cells in sheet.现在我的用户已经创建了一些函数(150 多个自定义函数)并且所有这些自定义函数都具有参数作为对工作表中其他单元格的引用。 When user updates some text cell (whether referred in some function call or not), whole sheet is refreshed and Excel shows busy in all cells having custom functions it.当用户更新某些文本单元格时(无论是否在某些 function 调用中提及),整个工作表都会刷新并且 Excel 在所有具有自定义功能的单元格中显示忙碌。 I understand that if a cell is referred in some custom function and it is updated, that custom function is called to show updated data, but it should not happen when user edits a cell not referred in any of the functions.我知道如果某个单元格在某些自定义 function 中被引用并且它被更新,则自定义 function 被调用以显示更新的数据,但是当用户编辑未在任何函数中引用的单元格时不应发生这种情况。

I cannot change sheet calculation mode to manual as it will stop updating other cells which are changed by user.我无法将工作表计算模式更改为手动,因为它将停止更新用户更改的其他单元格。 Also If I change calculation mode to Manual and on changing it back to Auto again refreshes whole sheet, so setting it to manual has drawbacks without gaining anything in my case.此外,如果我将计算模式更改为“手动”,然后再次将其更改回“自动”,则会刷新整个工作表,因此将其设置为“手动”有一些缺点,但对我来说没有任何好处。

Is it possible that your UDFs use volatile formulas such as NOW , TODAY , RANDBETWEEN , OFFSET , INDIRECT , INFO , SUMIF , RAND or you declared your UDFs to be volatile?您的 UDF 是否可能使用可变公式,例如NOWTODAYRANDBETWEENOFFSETINDIRECTINFOSUMIFRAND或者您声明您的 UDF 是可变的? In this case functions are recalculated if changes in any cells are made.在这种情况下,如果对任何单元格进行了更改,则会重新计算函数。 For example if you fill hundred thousand lines with RAND it takes few seconds to recalculate after entering any value to a blank cell.例如,如果您使用RAND填充十万行,则在向空白单元格输入任何值后需要几秒钟的时间来重新计算。

More on volatile formulas: Volatile values in functions有关易变公式的更多信息: 函数中的易变值

More on volatile formulas in UDFs: Excel Recalculation有关 UDF 中可变公式的更多信息: Excel 重新计算

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM