简体   繁体   中英

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

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:

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM