【发布时间】:2014-03-06 01:37:10
【问题描述】:
我正在尝试让一个 excel 宏工作,但我在从包含公式的单元格中复制值时遇到问题。
到目前为止,这就是我所拥有的,它适用于非公式单元格。
Sub Get_Data()
Dim lastrow As Long
lastrow = Sheets("DB").Range("A65536").End(xlUp).Row + 1
Range("B3:B65536").Copy Destination:=Sheets("DB").Range("B" & lastrow)
Range("C3:C65536").Copy Destination:=Sheets("DB").Range("A" & lastrow)
Range("D3:D65536").Copy Destination:=Sheets("DB").Range("C" & lastrow)
Range("E3:E65536").Copy Destination:=Sheets("DB").Range("P" & lastrow)
Range("F3:F65536").Copy Destination:=Sheets("DB").Range("D" & lastrow)
Range("AH3:AH65536").Copy Destination:=Sheets("DB").Range("E" & lastrow)
Range("AIH3:AI65536").Copy Destination:=Sheets("DB").Range("G" & lastrow)
Range("AJ3:AJ65536").Copy Destination:=Sheets("DB").Range("F" & lastrow)
Range("J3:J65536").Copy Destination:=Sheets("DB").Range("H" & lastrow)
Range("P3:P65550").Copy Destination:=Sheets("DB").Range("I" & lastrow)
Range("AF3:AF65536").Copy Destination:=Sheets("DB").Range("J" & lastrow)
End Sub
我怎样才能让它粘贴公式的值?
如果这可以更改/优化,我也将不胜感激。
【问题讨论】: