Excel VBA-带小时和分钟的截止日期?
假设我想在离事情发生还有一个小时的时候弹出一个msgbox,怎么做 我在想一些类似的事情:Excel VBA-带小时和分钟的截止日期?,excel,vba,date,time,Excel,Vba,Date,Time,假设我想在离事情发生还有一个小时的时候弹出一个msgbox,怎么做 我在想一些类似的事情: MyLimit = Now If .Value = MyLimit Then msgbox "Do that thing cause it is due right now" 或 并使公式引用日期格式为“m/d/yy h:mm AM/PM”的单元格 类似的方法不起作用,我想知道为什么。试试Application.OnTime方法 Sub setAlarm() Application.OnTim
MyLimit = Now
If .Value = MyLimit Then
msgbox "Do that thing cause it is due right now"
或
并使公式引用日期格式为“m/d/yy h:mm AM/PM”的单元格
类似的方法不起作用,我想知道为什么。试试Application.OnTime方法
Sub setAlarm()
Application.OnTime Range("deadline").Value - TimeValue("01:00:00"), "my_Procedure"
End Sub
Sub my_Procedure()
MsgBox "Do that thing cause it is due right now"
End Sub
msgbox在截止日期前一个小时弹出谢谢,我明天回去工作后会测试它,并告诉你它是否可以:)看起来不错,我不知道这种方法。
Sub setAlarm()
Application.OnTime Range("deadline").Value - TimeValue("01:00:00"), "my_Procedure"
End Sub
Sub my_Procedure()
MsgBox "Do that thing cause it is due right now"
End Sub