How to have vba execute every 10 minutes?

后端 未结 2 1059
孤城傲影
孤城傲影 2020-12-04 20:43

I need to have my macro executed every 10 minutes .

This allows it to work in 10 minutes

sub my_Procedure () 
msgbox \"hello world\"
end sub

sub t         


        
2条回答
  •  清歌不尽
    2020-12-04 21:04

    You should use this pattern:

    Sub my_Procedure()
        MsgBox "hello world"        
        Call test ' for starting timer again
    End Sub
    
    Sub test()
        Application.OnTime Now + TimeValue("00:10:00"), "my_Procedure"
    End Sub
    

提交回复
热议问题