Vba Time Elapse Help

gustgio

New Member
Joined
Jan 8, 2012
Messages
7
I need to create a time elapse between to cell entries

Column A - Once a cell in that field is populated, the clock begins ticking.
Column B - The real-time age in dd:hh:mm is populated in this column
* Column M & N - Once dates are populated in both of these columns, the clock in Column B Stops at that point.
Keep in mind A starts clock; and displays current time in B
Clock stops once BOTH M & N are populated.
Display the difference in the elapsed time in Collumn O
Also O2 can not recalulate when calcualting O3,O4, and so on..the script for the preceding cells needs to end and start fresh for every entry across rows = clock starts fresh wehn entering additonal info in a3, a4,a5 etc,and stops and keep the value when BOTH M& N are entered. O needs to be static and not change after antoehr instance of the clock starts..
 
Last edited:

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hi, welcome to the board.

Your post is pretty vague, but I've used macros that measure elapsed time between events.

Here's how I've done it - there are almost certainly better ways.

Code:
'=== CAPTURE START TIME IN CELL A1
Range("A1").Select
    ActiveCell = "=NOW()"
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues
 
'=== INSERT HERE THE CODE FOR WHAT HAPPENS BETWEEN THE START TIME AND END TIME
 
'=== CAPTURE END TIME IN CELL A2
Range("A2").Select
    ActiveCell = "=NOW()"
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues

Then, use a separate cell containing
Code:
=A2-A1
which will give you the elapsed time.

The way I use this is to have all of this done in a single macro, so that it tells me how long it takes for the macro to run, but you could have each part in a separate macro, so long as you are confident that the start and end times are being captured at the correct points in whatever your process is.
 
Upvote 0

Forum statistics

Threads
1,225,507
Messages
6,185,368
Members
453,288
Latest member
rlmorales2000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top