5. VBA Tips - Time Your Code
How do you time how long it takes for VBA code to run ?
Simple..
Step1: At the start of your code, create a variable called "Start" (or whatever)
Set it = Timer (that takes a snapshot of the time)
Step2: At the End of your code, you can use a messagebox to display how long it took.
MsgBox Timer - Start & " Seconds"
Download Spreadsheet to see example of how to Time VBA code
Training Video on how to time your code:
»
- Nick's blog
- Login or register to post comments
- 31300 reads
Could you post your code here?
Please post your code here.
convert to second
i tried your code in my macro and msgbox have shown 36258 seconds
but with a stopwatch i get 1':16" (1 min and 16 sec)!!!
but i could recolonize which one is correct.
pls advise.