help on start / stop problem

  • Hi all,


    i have currently a userform which when a user click the start button time the time and date appears a1/b1 respectively.in c1 an activity appears.


    When the user then clicks stop the end time date appears in d1/e1.


    My question is, is it possible to press start and select an activity and then start another activity but the program still remembers when you press stop for a certain activity it remembers which start time to put the stop time to.


    current is this


  • Are you asking to start another task at the same time?


    Your code changes the Start button to Stop, how will you begin another Task?


    I cannot see what use your second commandbutton is. It pops up the message if clicked, but why is it there?


    We can store the start time if needed but I would like to know what you need.

  • Ok I have work on the code, so one button starts one stops.


    My code needs to be able to start more than one task (i.e walking and talking) but when one stops or both do, the stop time will align back its start time.


    I.e if you started walking at 1:00 and then started talking at 1:02, there would be two start times recorded (a1 and a2). if you then stopped walking at 1:03 and stopped talking at 1:04, the program would assign the correct stop time to the correct start time


    Please ignore the old code.


    Any help let me know


    Private Sub CommandButton1_Click()
    Dim Rng As Range
    Set Rng = Cells(Rows.Count, "A").End(xlUp)(2, 1)
    Rng(1, 1).Value = Date
    Rng(1, 2).Value = Time
    Rng(1, 3).Value = ComboBox1.Value


    End Sub


    Private Sub CommandButton2_Click()
    Dim Rng As Range
    Set Rng = Cells(Rows.Count, "A").End(xlUp)(1, 1)
    Rng(1, 4).Value = Date
    Rng(1, 5).Value = Time
    End Sub

  • Hi,


    I think I know what you exactly want.


    You have 4 activities and you want to have a stopwatch for each one to start and stop the things.


    Also you must be interested in making analysis and good charts out of it.


    I have tried whatever i could think you want.


    Please see the zip file and let me know.


    BTW .. Thanks for your query... it was a good exercise.

    Thanks: ~Yogendra

  • Yjoshi and Roy thankyou,


    both are an amazing help.


    Yjoshi would it be possible to then feed this info into a timesheet of sorts.


    so each day you would start and stop events at the end of the day the info would go into a timesheet, i can send a copy of the timesheet im thinking of?


    what do you think? im doing this to show activity based costing and the relationship with each person. so im now thinking during the day a user can click on each activity and then click a button at the end of the day that creates from a generic timesheet a daily timesheet/summary. maybe i should go on yahoo messenger?

  • Hi Steve


    You could adapt the stop code to calculate time spent at each entry and then possibly create a PivotTable report from that


    I have created a Pivot Report. You will need to change the Code to suit the new Layout.

  • I think Roy's Idea is really cool.


    Let me know if you are unable to implement it with my sheet, in case you have opted for using my sheet.


    thanks...

    Thanks: ~Yogendra

  • Re: help on start / stop problem


    Hi guys,
    looking into this thread as I have been asked at work timing different assignments.


    I tried out yjoshi's stopwatch, but when I open the stop watch it is not possible to work with other docs in Excel, and I also have trouble locating the VB code for the actons.


    Therefore I am wondering if anyone have any solution on how to get the following:
    I was thinking of a button in cell A1 named "Start", when clicked on start time (date and time) will be inserted in first available column A.


    Cell B1 contains a button called "Stop", clicked on will put time in column B and move the marker to cell Dx (x, being row number of the latest stop time.


    Why D and not C? In column C I was thinking of a formula calculating the time and in column D I will fill in a short explanation what I did during the time.


    /Daniel

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!