分享

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

 邱茂林个人收藏 2013-09-17
在模块中添加,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

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多