编辑:阅读评论后:这是复制一系列单元格的更简单方法,然后将特殊(值)粘贴到其他地方。我获得了这段代码,我完全录制了一个宏。
Sub Macro1()
Range("A1:C3").Select
Selection.Copy
Cells(10,"D").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
如果您打算将 D10 范围复制到任何活动单元格,则更改
Cells(10, "D").Select
到
Cells(10, "D").copy
您还需要指定要特别粘贴的内容(值?格式?)所以您的完整代码应该像
Sub routine()
Dim rng As Range
Set rng = ActiveCell.CurrentRegion
Cells(10, "D").Copy
rng.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False 'This will only paste values
Application.CutCopyMode = False
End Sub