嗨,我一直在谷歌搜索一段时间,目前无法找到解决我的具体问题的方法。所以问题很简单我想选择并复制 a 并只粘贴值而不是生成值的公式。
我检查过: 复制整行(值不是公式)VBA
https://msdn.microsoft.com/en-us/library/aa195818(v=office.11).aspx
我正在使用的当前代码在下面我目前只使用“OutputWorksheet.Paste”,它正在粘贴行,但它也带有公式并尝试了“OutputWorksheet.PasteSpecial.xlPasteValues”,但它一直抛出“编译错误:预期函数或变量”
任何帮助将不胜感激,或者是根据一张表中的 cboMADropDown 值找到行的更好方法,复制该行并粘贴到另一张表中,只有值没有公式。
With InputWorksheet ' Set sheet we want to search
Set FindRow = .Range("O:O").Find(What:=cboMADropDown, LookIn:=xlValues) ' Set FindRow container by searching Column F with cboMADropDown Value and look for the cell value to compare
End With ' End the With Statement
FindRowNumber = FindRow.Row ' Set the FindRow row value to a number
InputWorksheet.Rows(FindRowNumber).EntireRow.Copy 'Grab contents of entire row which is going to be updated
LastRow = OutputWorksheet.Range("A" & Rows.Count).End(xlUp).Row 'Finds the last blank Row on the MA tracking history sheet
OutputWorksheet.Activate 'Activate the worksheet so the .select command works with no errors
OutputWorksheet.Rows(LastRow).Select 'Select last blank row from MA tracking history
OutputWorksheet.Paste 'Paste contents of the clipboard to backup
OutputWorksheet.Range("O" & LastRow).Value = TimeStamp 'Add time stamp for the update