Excel宏粘贴只是值

问题描述 投票:0回答:1

我写了宏从一张纸到另一张的复印日期。

Sheet1.Cells(i, 3).Copy
Sheet1.Paste Destination:=Sheet2.Cells(erow, 1)

但在表1中是公式,我想只复制值。如何更改此代码以解决我的需求?

excel excel-vba vba
1个回答
2
投票

使用:

Sheet1.Cells(i, 3).Copy
Sheet2.Cells(erow, 1).PasteSpecial xlPasteValues

要么:

Sheet2.Cells(erow, 1).Value = Sheet1.Cells(i, 3).Value
© www.soinside.com 2019 - 2024. All rights reserved.