vba 如何在不包含 ActiveXButton 的情况下复制/粘贴工作表数据

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

How to Copy/Paste Sheet Data Without Including ActiveXButtons

excelvbacopypaste

提问by Whauror

Problem:

问题:

I have a sheet that contains values, formulae and ActiveX buttons. The ActiveX buttons are used to append some of the data and copy/paste all of the values/formulae from the active worksheet to another a worksheet in a separate workbook.

我有一张包含值、公式和 ActiveX 按钮的工作表。ActiveX 按钮用于附加一些数据并将活动工作表中的所有值/公式复制/粘贴到单独工作簿中的另一个工作表。

Right now it works fine with one exception. When it pastes the copied range into the new workbook/worksheet it also pastes in the ActiveX buttons along with their respective code.

现在它工作正常,但有一个例外。当它将复制的范围粘贴到新的工作簿/工作表中时,它还会粘贴 ActiveX 按钮及其各自的代码。

I would like to know if there is a way to select everything, less the ActiveX buttons, add it to the clipboard and then paste it in as usual.

我想知道是否有办法选择所有内容,减去 ActiveX 按钮,将其添加到剪贴板,然后像往常一样粘贴。

Thanks in advance.

提前致谢。

回答by Tim Williams

Try this:

尝试这个:

Application.CopyObjectsWithCells=False
'do your copy
Application.CopyObjectsWithCells=True