How can I check for or cancel MULTIPLE pending application.ontime events in excel VBA?

后端 未结 4 365
遇见更好的自我
遇见更好的自我 2021-01-17 23:22

I\'m using the Application.Ontime event to pull a time field from a cell, and schedule a subroutine to run at that time. My Application.Ontime event runs on the Workbook_Be

4条回答
  •  爱一瞬间的悲伤
    2021-01-17 23:49

    or you can just create some cell (like abacus), for example:

    if I use application.ontime:

    if range("V1") < 1 then
    
        Application.OnTime dTime, "MyMacro"
    
        range("V1")=range("V1") + 1
    
     end if
    

    if I want to stop counting...

       Application.OnTime dTime, "MyMacro", , False
    
       range("V1")=range("V1") - 1
    

提交回复
热议问题