How to calculate time to rum a macro?

  • Thread starter Thread starter Madiya
  • Start date Start date
M

Madiya

I have few langthy macros which are taking around 2-3 min.
I want to calculate the exact time taken by macro.

Regards,
Madiya
 
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)
 
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 Consultingwww.cpearson.com
(email on the web site)







- Show quoted text -

JW and Chip,
Thank you for your prompt response.
both are working fine.
I love this group coz every one is ready to help.

Regards,
Madiya.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top