Excel VBA:如何在 range.copy 之后以编程方式删除行军蚂蚁

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1662622/
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-08 10:06:32  来源:igfitidea点击:

Excel VBA: how to programmatically remove the marching ants after range.copy

excelvbaexcel-vba

提问by Nick

I don't want to resort to SendKeys "{ESC}"

我不想诉诸 SendKeys "{ESC}"

回答by guitarthrower

application.cutcopymode = false

application.cutcopymode = false

回答by Robert Mearns

Try this code as an example. The key line is 'Application.CutCopyMode = False'

试试这个代码作为例子。关键是' Application.CutCopyMode = False'

Sub Test()
    Range("A1").Copy
    MsgBox "View Marching Ants"
    Range("A2").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
End Sub