Macro to copy values only from one sheet to anothe

2020-03-08 06:56发布

I've this VBA code

Sheets("log").Range("A125:f1000").Copy _ 
Sheets("data").Cells(Rows.Count, "A").End(xlUp).Offset(1)

and it copies perfectly from sheet log to data. The only problem I'm facing is that it copies formulas with it as well whereas I only want values. I want to use same VBA code with some modifications to paste values only.

2条回答
疯言疯语
2楼-- · 2020-03-08 07:40

Need to add PasteSpecial Paste:=xlPasteValues

Next time try Recording a macro and modifying the code

Sheets("log").Range("A125:f1000").Copy
Sheets("data").Cells(Rows.Count, "A").End(xlUp).Offset(1). _ 
PasteSpecial Paste:=xlPasteValues, _ 
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
查看更多
叛逆
3楼-- · 2020-03-08 07:58

Without using clipboard:

Sheets("data").Cells(Rows.Count, "A").End(xlUp).Offset(1).Value = Sheets("log").Range("A125:f1000").Value
查看更多
登录 后发表回答