![]() 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. This completes the timer portion of the code. Dim Seconds1 As Single Dim Seconds2 As Single
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |