Everything working fine up to 64 rows than it stop transferring data.
Option Explicit
Public dTime As Date
;Main program
Sub ValueStore ()
Dim dTime As Date
Range("B" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Range("A1").Value
Range("c" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Range("A2").Value
Range("D" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Range("A3").Value
Range("E" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Range("A4").Value
Range("F" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Range("A5").Value
Call StartTimer
End Sub
First button for start
Sub StartTimer()
dTime = Now + TimeValue("00:00:05") !here i tack 5 sec
Application.OnTime dTime, "ValueStore", Schedule:=True
End Sub
Second button for stop
Sub StopTimer()
On Error Resume Next
Application.OnTime dTime, "ValueStore", Schedule:=False
End Sub
Cells(Rows.Count).Row
is 64 in modern versions of Excel files. That is becauseRows.Count
will be 1048576, and thereforeCells(1048576)
is referring to cellXFD64
which is on row 64. Your code needed to specify a column so that it looked at the 1048576th cell in one column.