it copies the content of M3 (this is calculating based on a fomula) and copies it to column P is fine and keep a history - so copies to next available cell in column P - can start at Cell P1
This is just from memory
Look up the Application.OnTime for Excel
It is somewhat like an Alarm Clock
In a Worksheet module - add the code.
Place the sstartTime procedure in the Autpen event
code something like this:
Code:
Dim TimerActive As Boolean
Sub StartTimer()
Start_Timer
End Sub
Private Sub Start_Timer()
TimerActive = True
Application.OnTime Now() + TimeValue("00:00:03"), "Timer" 'ever 3 seconds
End Sub
Private Sub Stop_Timer()
TimerActive = False
End Sub
Private Sub Timer()
If TimerActive Then
ActiveSheet.Cells(1, 1).Value = Time
Application.OnTime Now() + TimeValue("00:00:03"), "Timer"
End If
End Sub
Your Excel must be saved as a Macro Enabled
The knowledge of the Debugging Tools will be very important
The management of these events will be tricky!
1 trying to code and the focus on the window gets interrupted every time the event triggers.
2 When multiple workbooks open, you close the one that's supposed to use the timer, and it keeps triggering and reopening the workbook (forgetting to kill the event properly).
Suggest testing every 30 seconds until the code works correctly