View Single Post
 
Old 07-14-2017, 08:47 AM
Logit Logit is offline Windows 10 Office 2007
Expert
 
Join Date: Jan 2017
Posts: 587
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

Code:
Option Explicit

Dim TimeToRun

'Sub auto_open()
'    Call ScheduleclrCol                        'uncomment this for code to auto run when sheet is opened
'End Sub

Sub ScheduleclrCol()
    TimeToRun = Now + TimeValue("00:01:00")     '<----- adjust time to fire here  HH:MM:SS
    Application.OnTime TimeToRun, "runmycode"
End Sub

Sub runmycode()

        
        'Your code here   <--- place your code here to be run once per minute
   

Call ScheduleclrCol
End Sub

'Sub auto_close()                               'uncomment this for code to auto stop when sheet is closed
'    On Error Resume Next
'    Application.OnTime TimeToRun, "clrCol, , False"
'End Sub

Sub manual_stop()                               'button click for stop (Manual Stop)
    On Error Resume Next
    Application.OnTime TimeToRun, "clrCol", , False
End Sub
Reply With Quote