复制整个行(值而不是公式)VBA [英] Copy Entire Row (Values not formulas) VBA
本文介绍了复制整个行(值而不是公式)VBA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在多个工作表之间复制行,尽管设法做到这一点,但它仅复制公式而不是值.我已经好多年没有使用VBA了,只是想不出该怎么做.
I need to copy rows between multiple worksheets and while I managed to do that it only copies the formulas and not the values. I haven't used VBA for years and I just can't think of how to do it.
我现有的代码是:
Workbooks.Open filename:=NewFN
filename = Mid(NewFN, InStrRev(NewFN, "\") + 1)
For i = 1 To 14
Workbooks(filename).Sheets("sheet1").Rows(i).Copy ThisWorkbook.Sheets("BD Raw Data").Rows(insertRow)
insertRow = insertRow + 1
Next i
Workbooks(filename).Close SaveChanges:=False
推荐答案
在过程的粘贴一半中进行值和公式之间的选择.看一下PasteSpecial方法,特别是xlPasteValues参数.
The choice between values and formulas is made in the paste half of the process. Have a look at the PasteSpecial method specifically the xlPasteValues argument.
http://msdn.microsoft.com/en-us/library/aa195818(v=office.11).aspx
这篇关于复制整个行(值而不是公式)VBA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文