Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calculating Elapsed time in a macro
I have a data stream that is providing time in military format (hh:mm:ss)in
column A begining at row 12, and I want to place elapsed time in column B. I've been subtracting the values of the cells using A12 as the reference value, but I'm getting just 0.0 Macro section as follows: it = Sheets("Data").Cells(12,1).value at = Sheets("Data").Cells(RowPointer, 1).value et = at - it Sheets("Data").Cells(RowPointer,2).Formula = et (it = initial time, at = actual time, et = elapsed time) Data would look like: 12:12:00 12:12:30 12:13:00 12:13:30 I need to get 0:00 0:30 1:00 1:30 into the second column, but doing the calculation in the macro, not in the sheet. Help! I'm stumped, using Excel 2000 right now. thanks Art |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calculating Elapsed time in a macro
Sub AAAAA()
For rowPointer = 13 To 15 With Sheets("Data") it = .Cells(12, 1).Value at = .Cells(rowPointer, 1).Value et = at - it ..Cells(rowPointer, 2).Value = et ..Cells(rowPointer, 2).NumberFormat = "hh:mm:ss" End With Next End Sub Worked for me. -- Regards, Tom Ogilvy Art D. wrote in message ... I have a data stream that is providing time in military format (hh:mm:ss)in column A begining at row 12, and I want to place elapsed time in column B. I've been subtracting the values of the cells using A12 as the reference value, but I'm getting just 0.0 Macro section as follows: it = Sheets("Data").Cells(12,1).value at = Sheets("Data").Cells(RowPointer, 1).value et = at - it Sheets("Data").Cells(RowPointer,2).Formula = et (it = initial time, at = actual time, et = elapsed time) Data would look like: 12:12:00 12:12:30 12:13:00 12:13:30 I need to get 0:00 0:30 1:00 1:30 into the second column, but doing the calculation in the macro, not in the sheet. Help! I'm stumped, using Excel 2000 right now. thanks Art |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculating Elapsed Time Over a Set Period | Excel Worksheet Functions | |||
Calculating Elapsed Time | Excel Worksheet Functions | |||
Calculating elapsed time | Excel Discussion (Misc queries) | |||
Calculating Time elapsed | Excel Worksheet Functions | |||
Calculating elapsed time | Excel Worksheet Functions |