Sub RecordPrice()
Dim WR As Long
Dim I As Byte
If IsError(Range("B2")) Or IsError(Range("C2")) Then Exit Sub
WR = Range("A1").End(xlDown).Row + 1
'ActiveWindow.ScrollRow = WR - 5 '只顯示最新幾筆資料
If (WR = 3) Or _
(Range("D" & WR - 1) <> Range("D2")) Then '總量有異動時才記錄
'For I = 1 To 13
'Cells(WR, I) = Cells(2, I)
'Next 'I
Cells(WR, 1).Resize(, 4) = [A2:D2].Value
Cells(WR, "E").Formula = "=RC[-3]-R[-1]C[-3]"
Cells(WR, "F").Formula = "=RC[-3]-R[-1]C[-3]"
End If
'For I = 1 To 9
' Cells(WR, I) = Cells(2, I)
'Next 'I
End Sub
請問版上前輩,我如果要將上述程式中Cells(WR, "E").Formula = "=RC[-3]-R[-1]C[-3]"跟 Cells(WR, "F").Formula = "=RC[-3]-R[-1]C[-3]",在執行完公式後在儲存格上面只顯示值,而不是公式,要如何修改呢? |