Question : Help with Macro - shouldn't take long.

My code gets stuck on the first Range("Now") line.  The error is 1004 application object-defined error.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
Option Explicit
Public dTime As Date
Private Sub Workbook_Open()
    Call ValueStore
End Sub
Sub ValueStore()
Dim dTime As Date
    Range("Now").Formula = "=VLOOKUP(TIME(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW())),Sheet2!$A$4:$Q$1444,16)+VLOOKUP(TIME(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW())),Sheet2!$A$4:"
    Range("Now_Plus_15").Formula = "=VLOOKUP(TIME(HOUR(NOW()),MINUTE(NOW())+15,SECOND(NOW())),Sheet2!$A$4:$Q$1444,16)+VLOOKUP(TIME(HOUR(NOW()),MINUTE(NOW())+15,SECOND(NOW())),Sheet2!$A$4:"
    Call StartTimer
End Sub


Sub StartTimer()
    dTime = Now + TimeValue("00:01:00")
    Application.OnTime dTime, "ValueStore", Schedule:=True
End Sub

Sub StopTimer()
    On Error Resume Next
    Application.OnTime dTime, "ValueStore", Schedule:=False
End Sub

Answer : Help with Macro - shouldn't take long.

Your formula is not finished. You're probably missing a $Q$1444,16) at the end.
Same thing on the following line actually.

Thomas
Random Solutions  
 
programming4us programming4us