'Same range to be pasted with different timestamps
I'm struggling with my code below. Basically I activate TimeRun to activate the base code. What I need is that Application.OnTime run 3-4 times with a few second difference, and then paste the values to A6, then A7, A8, etc onto destiantion sheet. Any ideas greatly appreciated.
Public Sub snap()
Dim sourceSheet As String, destinationSheet As String
Dim copyR As Range, pasteR As Range
sourceSheet = "Time pnl"
destinationSheet = "Snapshot"
With Sheets(sourceSheet)
Set copyR = .Range("p4")
End With
With Sheets(destinationSheet)
Set pasteR = .Range("a6")
copyR.Copy
pasteR.Value = copyR.Value
End With
pasteR.Columns(4) = Now()
End Sub
Public Sub TimeRun()
Application.OnTime TimeValue("11:25:20"), "snap"
End
End Sub
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
