![]() |
How to calculate time to rum a macro?
I have few langthy macros which are taking around 2-3 min.
I want to calculate the exact time taken by macro. Regards, Madiya |
How to calculate time to rum a macro?
Dim sTime as Single
sTime = Timer 'your code here MsgBox Timer-sTime Madiya wrote: I have few langthy macros which are taking around 2-3 min. I want to calculate the exact time taken by macro. Regards, Madiya |
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 |
How to calculate time to rum a macro?
On Oct 11, 6:41 pm, "Chip Pearson" wrote:
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) "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- Hide quoted text - - 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. |
All times are GMT +1. The time now is 09:58 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com