VBA:在其他工作表的下一个空行中复制和粘贴值

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

VBA: Copy and paste values in next empty row in other sheet

excelvbaexcel-vba

提问by user3049442

I'm trying to copy a range from "Sheet1" and pasting values, not code, to the next empty row in "Sheet2". I have found this code but it only copys and pastes code:

我正在尝试将范围从“Sheet1”和粘贴值而不是代码复制到“Sheet2”中的下一个空行。我找到了这段代码,但它只复制和粘贴代码:

Sheets("Sheet1").Range("G32:I54").Copy Sheets("Sheet2").Range("A60000").End(xlUp).Offset(2, 0) 'Select Case Sheets("Sheet1").Range("A1") = ""

Can anyone help pasting values and not code?

任何人都可以帮助粘贴值而不是代码吗?

回答by cyboashu

Sheets("Sheet1").Range("G32:I54").Copy 
Sheets("Sheet2").Range("A60000").End(xlUp).Offset(2, 0).pastespecial paste:=xlPasteFormats
Sheets("Sheet2").Range("A60000").End(xlUp).Offset(2, 0).pastespecial paste:=xlPasteValues
application.cutcopymode=false