Just use the following code and the running time of your macro will be printed, in seconds, on the immediate window:
Sub macro1()
Dim starttime, endtime As Double
starttime = Now
' your code here
endtime = Now
Debug.Print "Macro ran successfully in " & DateDiff("s", starttime, endtime) & " seconds"
Debug.Print "Macro ran successfully in " & DateDiff("s", starttime, endtime) & " seconds"
End Sub
No comments:
Post a Comment