Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 239
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 239
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 calculate time between 2 date/time columns Kevo Excel Discussion (Misc queries) 8 April 25th 09 12:02 AM
Calculate Ending time using Start Time and Elapsed Time Chief 711 Excel Worksheet Functions 5 May 13th 08 04:34 PM
calculate hours using start time & end time, excluding weekends noname Excel Programming 6 April 10th 07 03:30 PM
IF statement to calculate time usage in specific time bands Daren Excel Worksheet Functions 6 January 31st 07 01:34 PM
how to calculate time start & time finish in quarter hour Peter Wu Excel Discussion (Misc queries) 3 June 7th 06 12:58 AM


All times are GMT +1. The time now is 02:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"