View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ndel40 Ndel40 is offline
external usenet poster
 
Posts: 17
Default Dynamic Input Timer

You are correct, I did some testing and it needs to be a bit more robust and
I need to add some additional criteria. I would like it to only start the
timer if the cell in column "A" is blank and stop the timer when the data is
entered into column €śE€ť one row below the row where the timer started€¦ in
other words the data input range is 5 columns by two rows.

Input 1 Input 2 Input 3 Input 4 Input 5 Total Input Time
Start Timer 2 3 4 5
6 7 8 9 Stop timer 0:02:12


"Jacob Skaria" wrote:

The below will point you in the right direction...To make this robost you
will need to check the row number while picking the start time and validate
that when you output the time interval..Select the sheet tab which you want
to work with. Right click the sheet tab and click on 'View Code'. This will
launch VBE. Paste the below code to the right blank portion. Get back to to
workbook and try out.

'Format ColF to excel time format

Private Sub Worksheet_Change(ByVal Target As Range)
Static myTime As Variant
If Target.Count = 1 Then
If Target.Column = 1 Then
myTime = Now
ElseIf Target.Column = 5 Then
Application.EnableEvents = False
Target.Offset(, 1) = DateDiff("s", myTime, Now) / 86400
Application.EnableEvents = True
End If
End If
End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"Ndel40" wrote:

I would like have code in the sheet module that calculates the elapsed time
it takes a user to enter data into the spreadsheet. For example... A user
first data entry is in column "A" and last data entry is in column "E". I
would like to start a clock when they enter the data in column "A" and stop
it when the data in column "E" is entered and output to elapsed time in
column "F". Data will continue to be entered in descending order by row
every hour or so... that's why I believe the code needs to be dynamic in the
sheet module.

Input 1 Input 2 Input 3 Input 4 Input 5 Total Input Time
1 2 3 4 5 0:01:42
1 2 3 4 5 0:02:12
1 2 3 4 5 0:02:42
1 2 3 4 5 0:03:12

Any suggestions would be appreciated... thanks!