当前位置:首页经验技巧Excel经验excel入门

excel表格表倒数灯怎么做

2024-07-12 10:37:50

1.excel如何实现多个倒计时器自动倒计时

在模块中添加,B、C列设置格式为 hh:mm:ss

Sub sTime()

'每隔一秒钟调整本程序自身一次。

'增加D列,标记倒记时是否完成,

'添加新的倒计时,更改B列数据,删除对应C列、D列数据。

Application.OnTime Now + TimeValue("00:00:01"), "sTime"

For i = 2 To 14

If Cells(i, 3) > 0 Then

Cells(i, 3) = Cells(i, 3) - TimeValue("00:00:01")

If Cells(i, 3) = TimeValue("00:00:10") Then

'10秒倒记时,改变颜色,提示音,加在这儿,不另写了。

End If

Else

If Cells(i, 3) = TimeValue("00:00:00") And Cells(i, 4) = "" And Len(Cells(i, 3)) > 0 Then

Cells(i, 4) = "时间到"

Else

If Cells(i, 3) = 0 And Cells(i, 4) = "" Then Cells(i, 3) = Cells(i, 2)

End If

End If

Next i

End Sub

然后在工作表中添加一个按钮,调用:

Private Sub CommandButton1_Click()

Call sTime

End Sub


电脑版

免责声明:本站信息来自网络收集及网友投稿,仅供参考,如果有错误请反馈给我们更正,对文中内容的真实性和完整性本站不提供任何保证,不承但任何责任,谢谢您的合作。
版权所有:五学知识网 Copyright © 2015-2024 All Rights Reserved .