如何重新配置此VBA脚本以仅复制值
Sub CopyData()
Dim mRng As Range
Set mRng = Range([b11], [l11])
If Application.CountA(mRng) = 0 Then
MsgBox "Nothing to Send!!!"
Exit Sub
Else
xx = MsgBox("ARE YOU SURE?", vbYesNo, "Light26")
If xx = 6 Then: Selection.ClearContents: Range("D1").Select
If xx = 7 Then: Exit Sub
MsgBox "Thank You!!!"
mRng.Copy Sheets("Sheet2"). _
Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0)
End If
End Sub
答案 0 :(得分:0)
你应该使用PasteSpecial xlPasteValues
Sub CopyData()
Dim mRng As Range
Set mRng = Range([b11], [l11])
If Application.CountA(mRng) = 0 Then
MsgBox "Nothing to Send!!!"
Exit Sub
Else
xx = MsgBox("ARE YOU SURE?", vbYesNo, "Light26")
If xx = 6 Then: Selection.ClearContents: Range("D1").Select
If xx = 7 Then: Exit Sub
MsgBox "Thank You!!!"
mRng.Copy
Sheets("Sheet2"). _
Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
End If
End Sub