I am trying to make a timer. There is a type mismatch error.
VBA Code:
Option Explicit
Public TimerValue As Variant
Public ticker As Variant
Sub Start_Click()
ticker = Now
MacroRun
End Sub
Sub MacroRun()
Application.DisplayAlerts = False
TimerValue = Timer
Do Until Timer > TimerValue + 60
Loop
Tick
Application.DisplayAlerts = True
End Sub
Sub Tick()
If (DateValue("03/12/2022") + TimeValue(Cells(3, 3).Value & ":" & Cells(3, 4).Value & ":" & "0")) > Now() Then 'error type mismatch
MacroRun
Else
Alarm
Exit Sub
End If
End Sub
Sub Alarm()
Cells(1, 2) = "Alarm
End Sub