Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to measure time for processing periods?

Does anyone have any suggestions on how to measure time for processing periods?
I get a macro to perform a list of tasks. Before the first task perform, I
would like to add the starting time in cell A1, and After the last task
performed, I would like to add the ending time in cell B1, therefore, after
perform all the task under this macro, I get the starting and ending period,
once, I subtract two periods in cell C1, then I will know how long this macro
takes to finish all the task.
Does anyone have any suggestions on how to write this code for setting
starting and ending time into macro.
Thank for any suggestions
Eric
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default How to measure time for processing periods?

At the beginning of the macro, I would add this line of code (adapt the Sheet
name to your needs):
Range("Sheet1!A1").Value = Now()

At the end, do the same with:
Range("Sheet1!B1").Value = Now()

And in C1: = B1-A1

--
Message posted via http://www.officekb.com

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to measure time for processing periods?

Thank you for your suggestions
In cell A1, it returns 8/15/2007 14:18, do you have any suggestions on how
to display in 12 hr format, such as 2:18 PM? On the hands, once I subtract
both periods and return the value in cell C1, do you have any suggestions on
how to display in minute format, such as 45 mins / 72 mins?
Thank you for any suggestions
Eric

"squenson via OfficeKB.com" wrote:

At the beginning of the macro, I would add this line of code (adapt the Sheet
name to your needs):
Range("Sheet1!A1").Value = Now()

At the end, do the same with:
Range("Sheet1!B1").Value = Now()

And in C1: = B1-A1

--
Message posted via http://www.officekb.com


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default How to measure time for processing periods?

For 12 hour format in A1, format as dd/mm/yyyy h:mm AM/PM
For minutes in C1 format as [mm], but if you want to use the number of
minutes in a calculation, use =(B1-A1)*24*60 and format as General or
Number.
--
David Biddulph

"Eric" wrote in message
...
Thank you for your suggestions
In cell A1, it returns 8/15/2007 14:18, do you have any suggestions on how
to display in 12 hr format, such as 2:18 PM? On the hands, once I subtract
both periods and return the value in cell C1, do you have any suggestions
on
how to display in minute format, such as 45 mins / 72 mins?
Thank you for any suggestions
Eric


"squenson via OfficeKB.com" wrote:

At the beginning of the macro, I would add this line of code (adapt the
Sheet
name to your needs):
Range("Sheet1!A1").Value = Now()

At the end, do the same with:
Range("Sheet1!B1").Value = Now()

And in C1: = B1-A1



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to measure time for processing periods?

Thank everyone for your suggestions
Could you give me any suggestions on how to code it in macro?

Range("Sheet1!C3").Value = Text(Now(), "hh:mm AM/PM")
Which does not give a correct coding structure for macro.
Do you have any suggestion?
Thank for any suggestions
Eric

"David Biddulph" wrote:

For 12 hour format in A1, format as dd/mm/yyyy h:mm AM/PM
For minutes in C1 format as [mm], but if you want to use the number of
minutes in a calculation, use =(B1-A1)*24*60 and format as General or
Number.
--
David Biddulph

"Eric" wrote in message
...
Thank you for your suggestions
In cell A1, it returns 8/15/2007 14:18, do you have any suggestions on how
to display in 12 hr format, such as 2:18 PM? On the hands, once I subtract
both periods and return the value in cell C1, do you have any suggestions
on
how to display in minute format, such as 45 mins / 72 mins?
Thank you for any suggestions
Eric


"squenson via OfficeKB.com" wrote:

At the beginning of the macro, I would add this line of code (adapt the
Sheet
name to your needs):
Range("Sheet1!A1").Value = Now()

At the end, do the same with:
Range("Sheet1!B1").Value = Now()

And in C1: = B1-A1






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to measure time for processing periods?

I'd use something like:

with worksheets("sheet1").range("C3")
.numberformat = "mm/dd/yyyy hh:mm AM/PM"
.value = now
end with



Eric wrote:

Thank everyone for your suggestions
Could you give me any suggestions on how to code it in macro?

Range("Sheet1!C3").Value = Text(Now(), "hh:mm AM/PM")
Which does not give a correct coding structure for macro.
Do you have any suggestion?
Thank for any suggestions
Eric

"David Biddulph" wrote:

For 12 hour format in A1, format as dd/mm/yyyy h:mm AM/PM
For minutes in C1 format as [mm], but if you want to use the number of
minutes in a calculation, use =(B1-A1)*24*60 and format as General or
Number.
--
David Biddulph

"Eric" wrote in message
...
Thank you for your suggestions
In cell A1, it returns 8/15/2007 14:18, do you have any suggestions on how
to display in 12 hr format, such as 2:18 PM? On the hands, once I subtract
both periods and return the value in cell C1, do you have any suggestions
on
how to display in minute format, such as 45 mins / 72 mins?
Thank you for any suggestions
Eric


"squenson via OfficeKB.com" wrote:

At the beginning of the macro, I would add this line of code (adapt the
Sheet
name to your needs):
Range("Sheet1!A1").Value = Now()

At the end, do the same with:
Range("Sheet1!B1").Value = Now()

And in C1: = B1-A1





--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to measure time for processing periods?

Thank everyone for suggestions
Eric
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
Processing Time [email protected] Excel Worksheet Functions 0 July 20th 07 06:52 PM
measure calculation time for multiplication of two matrices Rasoul Khoshravan Excel Worksheet Functions 0 October 24th 06 01:45 PM
Want to measure macro elapsed time. Nevyenn Excel Discussion (Misc queries) 2 May 17th 06 05:13 PM
periods of time Ben New Users to Excel 1 March 5th 06 07:47 PM
I need to measure hours between two events(time/date) to give me . iartis Excel Worksheet Functions 2 May 12th 05 02:12 AM


All times are GMT +1. The time now is 12:48 PM.

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

About Us

"It's about Microsoft Excel"