Excel宏仅粘贴值 [英] Excel macro paste just values

查看:45
本文介绍了Excel宏仅粘贴值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了将日期从一张纸复制到另一张纸的宏.

I written macro which copy date from one sheet to other.

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

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

But in sheet 1 are formulas and I want to copy just values. How to change this code to solve my needs?

推荐答案

使用:

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

或者:

Sheet2.Cells(erow, 1).Value = Sheet1.Cells(i, 3).Value

这篇关于Excel宏仅粘贴值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆