复制并粘贴值而不是公式 [英] Copy and paste values and not formulas

查看:73
本文介绍了复制并粘贴值而不是公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一次编写宏,我只需要复制单元格值到另一个即可,但是我不确定,如何复制整个列而不指定范围,因为每次范围可能不同.在这里,我正在尝试一个有效的范围,但我希望它检查该列的单元格值,直到找到将值复制/粘贴到另一列为止.

Writing macro for the first time, I have to copy only cell values to another and which I got it working, however, I am not sure, how to copy entire column without specifying range since range may be different every time. Here, I am trying with a range which is working, but I want it to check values of cell for that column and until it finds a value copy/paste to the another column.

这是我到目前为止的代码:

Here is the code I have so far:

Sub CopyingCellValues()

Range("E2:E7").Copy
Range("C2:C7").PasteSpecial xlPasteValues

End Sub

谢谢.

推荐答案

简单列复制将...

Sheets("Sheet Name").Columns(1).Copy Destination:=Sheets("Sheet Name").Columns(2)


MSDN上获得帮助的信​​息从Excel 2010中的VBA开始

在没有公式的情况下,尝试

With out the formula, Try

Sub CopyingCellValues()
    Range("E:E").Value = _
    Range("C:C").Value
End Sub


Sub ValueToValue()
    [E:E].Value = [C:C].Value
End Sub

这篇关于复制并粘贴值而不是公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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