how to paste only values in excel

后端 未结 4 1532
情书的邮戳
情书的邮戳 2021-01-20 08:18

I\'m quite new to Excel and completely new to this forum.

I have taken the code from the below forum and modified it to my need.

http://pressf1.pcworld.co.nz

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-20 09:11

    You don't need to copy and paste to do this (at least in Excel 2010 and above, I think). You just set the .Value of the range to equal itself. eg:

    rng.Value = rng.Value
    

    or

    Sheet1.Range("A1:A10").Value = Sheet1.Range("A1:A10").Value
    

    since .Value "Returns or sets a Variant value that represents the value of the specified range."

    Note that this just works for values, not formats.

    http://msdn.microsoft.com/en-us/library/office/ff195193(v=office.15).aspx

提交回复
热议问题