execute macro at certain time in Excel

Q142. In Excel, how can I execute an event at a predetermined time from my Macro?

For example, my macro runs daily and is always ON. At exactly 5 PM, I would like it to perform a search for a report file for the day and update certain fields.

To do it in Excel, here is the answer:

  1. Option Explicit
  2. Public Sub ReportUpdate()
  3. Application.OnTime TimeValue("05:00:00 pm"), "UpdateDailyReportTable"
  4. End Sub
  1. Public Sub UpdateDailyReportTable()
  2. 'Report Update code goes here.
  3. End Sub

a) The macro "ReportUpdate()" must be running. When it runs, at exactly 5 PM, it calls "UpdateDailyReportTable" macro.

 

You can find similar Excel Questions and Answer hereunder

1) Converting numbers stored as text to numbers via macro in Excel

2) I have a complex voluminous workbook with lot of formulas. Every time I make an update, the processing is slow. Any workarounds available?

3) Can I determine the number of times a character appears in a cell using formula?

4) I frequently use a Macro - is there a way to quickly access the Macro in the Excel Ribbon?

5) I have a very complex macro that runs for a long time - is there any way I can set up an audible alarm indicating macro run is over?

6) How can I activate a routine when there is a change in value of a cell?

7) How to do date and time zone conversion in excel in Excel

8) Our financial Year is divided into 13 periods of 4 weeks each. I enter weekly YTD data. In Excel, how can I set up Worksheet to get Period data automatically?

9) I want to automatically run a procedure whenever I close my WorkBook so that it is in a known state - how can I achieve that?

10) Calling a macro from another workbook in Excel

11) Vba delete entire row if contains certain text in Excel

12) How can I fill a range of cells with incremental times?

13) I frequently use a Macro - is there a way to quickly access the Macro using a Keyboard Shortcut?

14) How can I prevent users from seeing / accessing my macro code?

15) I have a macro that takes a lot of time for execution - how can I keep the user informed that the macro is running?