I have a spreadsheet that has the word "Start" in cell A1 then it is intended that the sub below will insert a time in the first blank cell it finds in column A starting its search in A1 then working down the column.
This works fine for the first two times the sub is executed, so in puts a time in cell A2 then A3. After that it only updates cell A3.
What am I missing?
Thanks in advance for your help.
This works fine for the first two times the sub is executed, so in puts a time in cell A2 then A3. After that it only updates cell A3.
What am I missing?
Thanks in advance for your help.
Code:
Sub StartTime()
Dim HOUR As Long
Dim MINUTE As Long
Dim LAST_ROW_NUMBER As Long
HOUR = Int(Timer / 3600)
MINUTE = Round(((Timer / 3600) - Int(Timer / 3600)) * 60, 0)
LAST_ROW_NUMBER = Sheets("Sheet1").Range("A:A").Find("*", Sheets("Sheet1").Range("A1"), xlValues, xlPart, xlByColumns, xlNext).Row
Range("A" & LAST_ROW_NUMBER + 1) = "=TIME(" & HOUR & "," & MINUTE & ",0)"
End Sub