上海启嘟渡科技商贸有限公司
SEARCH

与我们合作

我们专注提供互联网一站式服务,助力企业品牌宣传多平台多途径导流量。
主营业务:网站建设、移动端微信小程序开发、营销推广、基础网络、品牌形象策划等

您也可通过下列途径与我们取得联系:

微 信: wxyunyingzhe

手 机: 15624122141

邮 箱:

vba 倒计时到零之后自动停止并提前一分钟提醒用户

更新时间:2024-12-29 18:06:32

建议用定时器,代码是网上搜的,我现在就在用。

Declare Function SetTimer Lib "user32.dll" ( _

ByVal hWnd As Long, _

ByVal nIDEvent As Long, _

ByVal uElapse As Long, _

ByVal lpTimerFunc As Long) As Long

Declare Function KillTimer Lib "user32.dll" ( _

ByVal hWnd As Long, _

ByVal nIDEvent As Long) As Long '###########以上有两个Api为SetTimer及KillTimer############

Private TimerID As Long '########上面是一个定时的ID便于你管理多个定时器##############

'*****************************************

Sub TimerProc(ByVal hWnd As Long, ByVal nMsg As Long, _

ByVal nTimerid As Long, ByVal dwTime As Long)

On Error Resume Next '#######注意上方的错误处理#########

ThisWorkbook.Sheets("A").Cells(1, 14).Value = Now()

If Minute(Now) = 30 And Second(Now) = 0 Then

Call AA

ElseIf Minute(Now) = 0 And Second(Now) = 0 Then

Call AAA

Else

End If

End Sub

多重随机标签

猜你喜欢文章

QQ客服 电话咨询