Hi, @TMS
I am new to Excel and does not know anything about coding.
Can you please sir add these changes in the code and reply me in this thread with full changed code in it.
Thanks a lot
I tried and this is result i got. But when i click F5 to run file just got hanged every time.
Option Explicit
Dim dtNextTick As Date
Sub StartTimer()
Dim lSec As Long
Dim Tm As Date
Tm = Range("D1").Value2
lSec = Second(Tm)
dtNextTick = Tm + TimeSerial(0, 0, 60 - lSec)
Application.OnTime dtNextTick, "UpdateData"
End Sub
Sub UpdateData()
Dim lRow As Long
Dim lRowB As Long
Debug.Print Time & " <> " & dtNextTick
With ThisWorkbook.Worksheets("Sheet1")
lRow = .Cells(.Rows.Count, "J").End(xlUp).Row
lRowB = .Cells(.Rows.Count, "B").End(xlUp).Row
If lRow < lRowB Then
Call StartTimer
.Cells(lRow + 1, "J").FormulaR1C1 = .Cells(lRow, "J").FormulaR1C1
.Cells(lRow + 1, "L").Resize(, 2).FormulaR1C1 = .Cells(lRow, "L").Resize(, 2).FormulaR1C1
.Cells(lRow + 1, "R").Resize(, 2).FormulaR1C1 = .Cells(lRow, "R").Resize(, 2).FormulaR1C1
.Cells(lRow, "J").Value = .Cells(lRow, "J").Value
.Cells(lRow, "L").Resize(, 2).Value = .Cells(lRow, "L").Resize(, 2).Value
.Cells(lRow, "R").Resize(, 2).Value = .Cells(lRow, "R").Resize(, 2).Value
End If
End With
End Sub
Sub StopTimer()
On Error Resume Next
Application.OnTime dtNextTick, "UpdateData", , False
On Error GoTo 0
End Sub
'code also in ThisWorkbook module
Bookmarks