[attach]22992[/attach]
Sub RecordPrice()
Dim WR As Long
Dim I As Long
WR = Range("A1").End(xlDown).Row + 1
[A2] = TimeValue(Now)
For I = 1 To 8
Cells(WR, I) = Cells(2, I)
Next 'I
With ActiveWindow
If Intersect(Cells(WR, "B"), .VisibleRange) Is Nothing Then .SmallScroll 1
End With
End Sub
WR = Range("A1").End(xlDown).Row + 1
'ActiveWindow.ScrollRow = WR - 5 '只顯示最新幾筆資料
If (WR = 3) Or _
(Range("G" & WR - 1) <> Range("G2")) Then '總量有異動時才記錄
For I = 1 To 8
Cells(WR, I) = Cells(2, I)
Next 'I
End If
Application.ScreenUpdating = False
With Sheets("RTD")
.Rows(3).Insert
.[A3].Resize(1, 8) = .[A2].Resize(1, 8).Value
End With
Application.ScreenUpdating = True
End Sub作者: c_c_lai 時間: 2015-12-28 19:18