Make a macro wait before next command in Excel

To do it in Excel, here is the answer:

  1. Option Explicit
  2. Public Sub WaitExample()
  3. 'code with functionality goes here. At this point, 5 sec wait is introduced.
  4. Application.Wait (Now + TimeValue("00:00:05"))
  5. code with functionality goes here.
  6. End Sub

a) The TimeValue argument is of the format "hh:mm:ss". So to introduce a 1 min wait, the argument becomes "00:01:00".

 

You can find similar Excel Questions and Answer hereunder

1) 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?

2) I want to automatically run an initialization procedure whenever I open my WorkBook so that it is ready for use - how can I achieve that?

3) How do I assign a macro to a shape using VBA?

4) How to enable or disable macros execution or loading in Excel

5) After several iterations, I have finalized my WorkBook - how do I make it Read-only from then on to prevent further edits?

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

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

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

9) How can I avoid updates to cell values during macro execution?

10) How can I see where page breaks occur before actually printing?

 

Here the previous and next chapter