使用macros粘贴值时出错
为什么我的代码下面只能粘贴值? 结果是粘贴公式而不是值。 谁能帮忙?
请检查我的代码如下:
Sheets("Invoice Print").Activate Range("F21:F27").Select Selection.SpecialCells(xlCellTypeFormulas, 1).Select Selection.Copy Sheets("Outgoing Goods").Select Cells(Rows.Count, 1).Range("K1").End(xlUp).Offset(1, 0).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ActiveSheet.Paste Application.CutCopyMode = False
有什么错误吗?
PS:我正在使用Excel 2013。
请指教。
谢谢。
你用ActiveSheet.Paste
覆盖下一行的粘贴值
你也不应该使用Selection.
和Selection.
。
Sheets("Invoice Print").Range("F21:F27").SpecialCells(xlCellTypeFormulas, 1).Copy With Sheets("Outgoing Goods") .Cells(.Rows.Count, 1).Range("K1").End(xlUp).Offset(1, 0).PasteSpecial _ Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False 'This line would overwrite the pasted values with not explecit values only 'ActiveSheet.Paste Application.CutCopyMode = False End With
希望我能帮上忙。