Solved

Excel 2010:  Macro Button Stop Watch

Posted on 2013-06-17
7
1,264 Views
Last Modified: 2013-06-20
Curious if someone has a stop watch macro that I can use.  I'd like to track how much time worked on each event on my spreadsheet.  If I had a macro button I could embed on each row, I could click on each button in each row to do this.  I could click on this button before I begin, then click on the button when finished.  It would then populate the total time worked in column L of my spreadsheet in each cell.  If it could compute a running total of timed worked that would be awesome too.  Thank you for your help.
0
Comment
Question by:itsmevic
  • 4
  • 3
7 Comments
 

Author Comment

by:itsmevic
ID: 39254739
i think i found a macro that works just need to enter proper syntax for entire L column range.  Any help is appreciated.  Thanks.

Private Sub TickTock()
Range ("L2").Value = Format (Time - t, "hh:mm:ss")
NextTick = Now + TimeValue ("00:00:01")
Application.OnTime NextTick, "TickTock"
End Sub
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39254755
What do you mean by entire L column? Can you give an example?
0
 

Author Comment

by:itsmevic
ID: 39254782
Here is a screenshot of the spreadsheet and button set-up.  Hopefully this will help.
20130617-174458515382038.jpg
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 39254807
Can  you consider having one set of buttons and select the desired cell? In this case your macro could be

Private Sub TickTock()
selection.Value = Format (Time - t, "hh:mm:ss")
NextTick = Now + TimeValue ("00:00:01")
Application.OnTime NextTick, "TickTock"
End Sub
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39255224
Please upload your excel file so that we can continue from there. Fake the values if needed.
0
 

Author Comment

by:itsmevic
ID: 39256638
the module you provided was nice, however it doesnt track total time.  i.e. It doesnt start from 00:00:01 and count up.  Being able to click on the cell to start and stop is nice, the only problem with the current module is that it doesnt matter where you click on the worksheet it will embed a clock and not a timer.  I need a timer that can be stopped and started via a button or buttons (start and stop button) or stopped and started with a double-click and limit to one columns entire range if need be.  Hope that makes sense.
0
 

Author Comment

by:itsmevic
ID: 39258384
Here is a sample file...
Example.xlsx
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now