Tuesday, April 19, 2011

How to Use the Excel OnTime Method


Specific Time
1. Click on the 'Developer' tab. If you do not see it, then click on the 'Microsoft Office' button. Click the 'Excel Options' button. Click on the 'Popular' tab. Check the 'Show Developer tab in the ribbon' check box. Click the 'OK' button.
2. Click the 'View Code' icon in the Controls section.
3. Type the following code:Private Sub Workbook_Open()Application.OnTime TimeValue ('13:00:00'), 'YourProcedure'End SubThis tells excel to run the procedure, or macro, named YourProcedure to run at 1 p.m.
Lapsed Time
4. Click on the 'Developer' tab.
5. Click the 'View Code' icon in the Controls section.
6. Type the following code:Private Sub Workbook_Open()Application.OnTime Now TimeValue ('00:05:00'), 'YourProcedure'End SubThis tells excel to run the procedure, or macro, named YourProcedure to run five minutes from now.

Blogger news