I have a problem because I have code that copies entire columns, but I would like to change this code to copy only the values under the headers because in the second file I have pivot tables set. copy vintage file but would like to start with A2: C2
wbMe.Sheets("input_4").Range("A:D").ClearContents
wb.Sheets("vintage_agr").Columns("A:C").Copy
wbMe.Sheets("input_4").Range("A1").PasteSpecial Paste:=xlPasteValues
wb.Sheets("vintage_agr").Columns("H").Copy
wbMe.Sheets("input_4").Range("D1").PasteSpecial Paste:=xlPasteValues
This Should work..
wbMe.Sheets("input_4").Range("A:D").ClearContents
wb.Sheets("vintage_agr").Range("A2:C" & rows.count-1).Copy
wbMe.Sheets("input_4").Range("A1").PasteSpecial Paste:=xlPasteValues
wb.Sheets("vintage_agr").Range("H2:H" & rows.count-1).Copy
wbMe.Sheets("input_4").Range("D1").PasteSpecial Paste:=xlPasteValues
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.