是否可以重新计算VBA中的单元格或范围 [英] is it possible to recalculate only a cell or a range in VBA

查看:178
本文介绍了是否可以重新计算VBA中的单元格或范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以仅重新计算VBA中的单元格或范围?我喜欢用于工作表的内容如下,但是如何在单元格上进行操作?或范围?

is it possible to recalculate only a cell or a range in VBA ? What I like to use for a sheet is the following, but how to do it on a cell only ? Or range ?

'    ActiveSheet.EnableCalculation = False
'    ActiveSheet.EnableCalculation = True


推荐答案

有一个可以调用范围的计算方法:

There is a calculate method you can call on ranges:

Range("A1").Calculate

通过在A1中放置= Now()并运行Calculate并观察它更新秒:)尝试一下它可以通过使用以下方式重新计算一个工作表中的所有单元格:

Try it out by putting =Now() in A1 and running Calculate and watch it update the seconds :) You can for a recalc of all the cells in a sheet by using:

Sheets(1).Calculate

另请参阅:Microsoft MSDN, Excel重新计算,2012年7月16日。

See also: Microsoft MSDN, Excel Recalculation, 16 July 2012.

这篇关于是否可以重新计算VBA中的单元格或范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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