我只需要将值粘贴到单元格中。所以我操纵Ctrl
+ V
键来运行以下宏。
有三种复制文本的可能性。
以下宏的问题仅是一种情况(工作表内复制)正在运行。我应该怎样改变才能获得所需的结果?
已更新:
Sub PasteSP()
Dim DataObj As MSForms.DataObject
Set DataObj = New MSForms.DataObject
DataObj.GetFromClipboard
Select Case Application.CutCopyMode
Case Is = xlCopy
Selection.Cells.PasteSpecial xlPasteValues
Case Is = xlCut
Selection.Cells.Paste ''Now problem lies here
Case Is = False
Selection.Value = DataObj.GetText(1)
End Select
End Sub