0
考虑到我已经通过另一个线程解释了“如何粘贴到第一个空白单元格”...... here 我需要知道如何粘贴“值”。 例子:Excel:如何将“值”粘贴到第一个空白单元格?
Dim sh As Worksheet, tCell As Range
Sheets("Lunch Extend").Range("B4:F31").Copy
Set sh = Sheets("Backup")
Set tCell = FreeCell(sh.Range("B3"))
sh.Paste PasteSpecial xlValues tCell
然而,最后的行不正确读取。任何帮助?
sh.Paste tCell
...的作品,但我需要的价值观。谢谢。
添加这里接龙功能...
Function FreeCell(r As Range) As Range
' returns first free cell below r
Dim lc As Range ' last used cell on sheet
Set lc = r.Offset(1000, 0).End(xlUp).Offset(1, 0)
Set FreeCell = lc
End Function
您的语法对于Sheet.PasteSpecial方法是不正确的,但它可能会更简单地使用Range.PasteSpecial方法。请参阅VBA帮助以正确使用这些方法。 – 2014-12-05 17:30:41