View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default How to calculate time to rum a macro?

You can try something like the following:


Sub AAA()
Dim StartTime As Double
Dim EndTime As Double

StartTime = Now
'''''''''''''''''''''''''''''''''''''
' your code here
'''''''''''''''''''''''''''''''''''''
EndTime = Now
Debug.Print "Time To Run: " & _
Format((EndTime - StartTime) * 24 * 60 * 60, "#,##0") & " seconds"
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Madiya" wrote in message
ps.com...
I have few langthy macros which are taking around 2-3 min.
I want to calculate the exact time taken by macro.

Regards,
Madiya