![sub macro phraseexpress sub macro phraseexpress](https://i0.wp.com/filecr.com/wp-content/uploads/2021/08/phraseexpress-free-download-03.jpg)
This Wait function will allow us to add waiting time till the complete code may get run. And for this type Application followed a dot (.) and then from the list search and select Wait function as shown below. Now to make this code small and simple we will use the inbuilt functions of VBA. Because doing something when the code is running may crash the file.įor this open a new module and write the Subcategory in the name of the required function or any name as shown below. By doing this we will allow the user to wait time whole code get to run, and operation is completed. This can be used where we create a tool or macro with a huge line of code structure. There is another method where we can choose a time lapse of any small amount as waiting time and let user or operator wait till the process gets completed. We may see slightly more difference if the written code is huge. We will see a message box with a counted time of 0 Seconds as the time required to run the complete code was 0. Once done, run the complete code by using F5 key or clicking on the play button as shown below. MsgBox ("Time taken:" & vbNewLine & Seconds2 - Seconds1 & " seconds") In below screenshot, we printed a text “Time taken:” and the difference between Seconds2 and Seconds1 with unit seconds. For this, we need to print the output in the message box as shown below. Now we need to see the time lapse in running the code.
![sub macro phraseexpress sub macro phraseexpress](https://i.imgur.com/ZzUq2lF.png)
![sub macro phraseexpress sub macro phraseexpress](https://www.portablefreeware.com/screenshots/scrDZ6Fob.png)
This completes the timer portion of the code. Dim Seconds1 As Single Dim Seconds2 As Single