vba 刷新单个工作表上的数据

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20387642/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-12 00:48:52  来源:igfitidea点击:

Refresh Data on single sheet

excel-vbavbaexcel

提问by Michel Lemieux

I have looked around quite a bit but can't seem to find what I a looking for...

我环顾四周,但似乎找不到我要找的东西......

I would like to be able to Refresh Data on a SINGLE sheets. That is to re-import the External Data text file.

我希望能够在单个工作表上刷新数据。即重新导入外部数据文本文件。

You can do this in Excel by using clicking on the Refresh Data button (on the Data tab) but I cannot find the equivalent in VBA.

您可以通过单击“刷新数据”按钮(在“数据”选项卡上)在 Excel 中执行此操作,但我在 VBA 中找不到等效项。

Any help on this would be greatly appreciated. TIA

对此的任何帮助将不胜感激。TIA

回答by Michel Lemieux

Found my answer!!!

找到我的答案!!!

ActiveSheet.QueryTables.Item(1).Refresh

ActiveSheet.QueryTables.Item(1).刷新

That is where the bugger was hidding... I knew it had to be possible!

那就是那个家伙藏身的地方……我知道这一定是可能的!