Sub TimeMyMacro()
Dim sngStart as Single, sngEnd as Single
sngStart = Timer
' call you macro
sngEnd = Timer
msgbox "It took " & format(sngEnd - sngStart,"0") & " seconds"
End Sub
The resolution of Timer is about 1 second.
For more resolution, see the techniques in this article.
http://support.microsoft.com/support.../q172/3/38.asp
HOWTO: Use QueryPerformanceCounter to Time Code
--
Regards,
Tom Ogilvy
"Pradip Jain" wrote in message
...
I want to check the time (in seconds) which my macro takes to run.
what code can be used.
thanks
pradip