如何让Excel从VBA中刷新数据? [英] How do you get Excel to refresh data on sheet from within VBA?

查看:1993
本文介绍了如何让Excel从VBA中刷新数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让Excel中的电子数据表数据从VBA中重新计算,而不用改变单元格的值?

How do you get spreadsheet data in Excel to recalculate itself from within VBA, without the kluge of just changing a cell value?

推荐答案

以下几行将会诀窍:

ActiveSheet.EnableCalculation = False  
ActiveSheet.EnableCalculation = True  

编辑:.Calculate()方法对所有函数都不起作用,附加数组函数。我正在使用的生产表是非常复杂的,我不想尝试并测试.CalculateFull()方法,所以它可以工作。

The .Calculate() method will not work for all functions, I tested it on a sheet with add-in array functions. The production sheet I'm using is complex enough I don't want to try and test the .CalculateFull() method, so it may work.

这篇关于如何让Excel从VBA中刷新数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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