Sub 委買委賣1分鐘()
Dim r&
Range("a2").Value = Time
If Range("A1") = "停止中" Then Exit Sub
If Second(Time) = 0 Then
r = Cells(Rows.Count, 1).End(xlUp).Row + 1
If r < 13 Then r = 13
Range("A" & r & ":K" & r) = [A2:K2].Value
r = r - 4: If r < 13 Then r = 13
[N3:N7] = Range("A" & r).Resize(5).Value
[O3:O7] = Range("D" & r).Resize(5).Value
[P3:Q7] = Range("G" & r).Resize(5, 2).Value
End If
Application.OnTime Now + TimeValue("00:00:01"), "工作表1.委買委賣1分鐘"
End Sub
'================================
Sub 清除數據()
Dim r&
Cells.EntireColumn.Hidden = False '把隱藏都取消'
r = ActiveSheet.UsedRange.Rows.Count
If r > 12 Then Range("A13:K" & r).EntireRow.Delete
Columns("B:C").EntireColumn.Hidden = True '隱藏BC列
Columns("E:F").EntireColumn.Hidden = True '隱藏EF列
[N3:Q7].ClearContents
End Sub