+ Reply to Thread
Results 1 to 2 of 2

Time capturing

Hybrid View

  1. #1
    Registered User
    Join Date
    06-02-2007
    Posts
    7

    Time capturing

    Hi,
    I have a requirement where in i need to capture time taken by the user to enter the data in a cell.
    For eg.,, if user starts entering data in A1 and if the text is Testing.
    The moment he enter T, we need to capture the time and when he completes entering the test we need to capture one more time.

    It should like like this.
    A1 B1 C1
    Testing 19/11/2008 07:45:44 19/11/2008 07:45:50

    Can some one please help.


    Thanks,
    Jai

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: Time capturing

    Is this what you are looking for? I would like to add the workbook, but can't (somehow) at the moment, so put this code in Worksheet1 (TAB, right click, view code, copy->paste
    I've also made a validation list on A1, 'Testing, Stop Testing' and a Conditional format where =if(A1="Testing",1,0) makes cell A1 Green and =if(A1="Stop Testing",1,0) makes it Red. Sorry for the inconvenience.
    Private Sub Worksheet_Change(ByVal Target As Range)
    
    Dim TimerStart As Date, TimerStop As Date
    
    If Target.Address = "$A$1" Then
      Select Case Target
        Case "Stop Testing"
          TimerStop = Now()
          Range("C1") = TimerStop
          Range("D1") = TimerStop - TimerStart
        Case "Testing"
          TimerStart = Now()
          Range("B1") = TimerStart
        Case Else
      End Select
    End If
    End Sub
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1