Timing code to run at certain times or on a repeating schedule can be done in two ways.
1. By using the windows task scheduler. Here you must use either the Workbook_Open or Auto_Open to run your code. At the end of the macro you should exit out of Excel(not just the workbook).
2. By leaving your workbook open and setting up a timer to monitor the system clock. This method can be done in a couple ways. You could use an OCX timer on an open userform. Or you could do something like this;
In the code "DoMyCode" you need to ensure that it does not start again before it has finish. You may also want to add a 1 second delay in this code too so that it only runs once in a 24 hour period.
Bookmarks