[英]Copy and paste cell values (not formulae) from one sheet to another
I am trying to copy and paste the values of a large number of cells from one sheet to another. 我正在尝试将大量单元格的值从一张纸复制并粘贴到另一张纸。 I tried
我试过了
Sheets("Sheet1").Range("A1:Z150").Copy Destination:=Sheets("Backup").Range("A1")
It copies the formulae instead. 而是复制公式。
Adding .Value
results in the error Object required
. 添加
.Value
导致错误Object required
。
I also tried. 我也试过了。
Sheets("Sheet1").Range("A1:Z150").Value = Sheets("Backup").Range("A1").Value
How do I copy cell values? 如何复制单元格值?
如果要使用value
,则两个范围的大小应相同:
Sheets("Sheet1").Range("A1:Z150").Value = Sheets("Backup").Range("A1:Z150").Value
You can try this: 您可以尝试以下方法:
Sheets("Sheet1").Range("A1:Z150").Copy
Sheets("Backup").Range("A1").PasteSpecial xlValues
You could use Address property of Range object to be sure to reference the same address in different ranges: 您可以使用Range对象的Address属性来确保引用不同范围内的相同地址:
With Sheets("Sheet1").Range("A1:Z150")
Sheets("Backup").Range(.Address).Value = .Value
End With
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.