有专家能告诉我如何防止“每日报告”中的公式被结转吗?具体来说,E2 中有一个公式,我只想结转数据,而不是公式。谢谢!!
Private Sub CommandButton1_Click()
Response = MsgBox("Are you sure?", vbYesNo)
If Response = vbNo Then Exit Sub
Dim nextrow As Long
nextrow = Worksheets("Weekly Summary").Cells(Rows.Count, "A").End(xlUp).Row + 1
Worksheets("Daily Report").Range("E2:E17").Copy Worksheets("Weekly Summary").Range("A" & nextrow)
Worksheets("Daily Report").Range("E3:E17").ClearContents
End Sub
答案1
这是一个复制/粘贴的简单示例,其中公式被其值替换:
Sub KopyKat()
Dim r1 As Range, r2 As Range
Set r1 = Range("A1:A3")
Set r2 = Range("B1:B3")
r1.Copy
r2.PasteSpecial (xlPasteValues)
End Sub