PC Review


Reply
Thread Tools Rate Thread

How to calculate time to rum a macro?

 
 
Madiya
Guest
Posts: n/a
 
      11th Oct 2007
I have few langthy macros which are taking around 2-3 min.
I want to calculate the exact time taken by macro.

Regards,
Madiya

 
Reply With Quote
 
 
 
 
JW
Guest
Posts: n/a
 
      11th Oct 2007
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


 
Reply With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      11th Oct 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have few langthy macros which are taking around 2-3 min.
> I want to calculate the exact time taken by macro.
>
> Regards,
> Madiya
>


 
Reply With Quote
 
Madiya
Guest
Posts: n/a
 
      11th Oct 2007
On Oct 11, 6:41 pm, "Chip Pearson" <c...@cpearson.com> 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" <madiya...@yahoo.co.uk> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> >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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate Ending time using Start Time and Elapsed Time Chief 711 Microsoft Excel Worksheet Functions 5 13th May 2008 04:34 PM
Formula to calculate time between start time and End time =?Utf-8?B?Um9ieQ==?= Microsoft Access Forms 5 21st Oct 2006 06:06 PM
how to calculate time start & time finish in quarter hour =?Utf-8?B?UGV0ZXIgV3U=?= Microsoft Excel Misc 3 7th Jun 2006 12:58 AM
Calculate elapsed time excluding time for breaks, lunch, etc =?Utf-8?B?U0pSQG1iY2k=?= Microsoft Access 2 12th May 2006 08:34 PM
Macro that hide or unhide and not calculate or calculate Jonsson Microsoft Excel Programming 1 19th Aug 2003 04:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:41 PM.