如何使用VBA在Excel 2010中刷新单元格? [英] How to refresh cells in Excel 2010 using VBA?

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

问题描述

如何通过VBA刷新所有单元格

如何让Excel从VBA中刷新表格中的数据?

我正在使用上面显示的所有解决方案: p>

I am using all the solutions that appear above:

ActiveSheet.EnableCalculation = False  
ActiveSheet.EnableCalculation = True

Application.Calculate

Application.CalculateFull

但没有一个在excel 2010中工作,当我去单元格,右键单击 refresh 它有效。如何在VBA中刷新它。

but none of them works in excel 2010, when I go to the cell and right click refresh it works. How can I refresh it within VBA.

此选项: Sheets(Name_of_sheet)。Range(D424)。Refresh 提出异常438

问题:


  1. 如何使脚本支持 excel 2003,2007,2010

  2. 我可以选择使用VBA源文件进行刷新吗?



编辑:




  1. 我想在工作表3 中的菜单中模拟鼠标右键并选择刷新。这就是所有的故事。

  1. I want to simulate a right mouse clicking and choosing refresh in the menu in worksheet 3. that's the all story.

我在10年前创建的excel文件上工作。当在excel 2010中打开它,我可以去一个单元格,右键单击它并选择刷新,然后选择.txt文件来刷新,它的工作正常。现在,当我在VBA中自动尝试时,所有上述代码都没有帮助。

I work on excel file which created 10 years ago. When opening it in excel 2010, I can go to a cell and right click on it and choose refresh and then choose the .txt file to refresh from, and it works just fine. Now when I try to do it automatically within VBA all the code above doesn't help.


推荐答案

您可以尝试使用 Application.Calculation

Application.Calculation = xlCalculationManual
Application.Calculation = xlCalculationAutomatic

这篇关于如何使用VBA在Excel 2010中刷新单元格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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