|
-
Sep 13th, 2005, 01:45 PM
#1
Thread Starter
New Member
Non VB user needs Excel help
Hello All;
First off I do not use VB but am willing to try and learn. The reason I choose to register and post here is you folks really seem to know your stuff.
So here is my question.
I am trying to find a way of timing work in MS Excel.
I want to be able to click a start timing button and a stop timing button on a job by job ( (row by row) basis and get the amount of time used up in a given cell.
Now here is the other part. I want to be able to time a work job (start and then stop) then go back to the same job hit start again and then stop again and have it add the new time to the previous time total so that the time is cumulative.
Can this be done???
-
Sep 13th, 2005, 01:56 PM
#2
Re: Non VB user needs Excel help
Welcome to the Forums mayakovski. 
I take it that this is for a specific workbook and not all in general?
What version of Excel are you running? What happens if the user clicks somewhere else in Excel doing some work on that job and then reselects/click that job?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 13th, 2005, 02:10 PM
#3
Re: Non VB user needs Excel help
When you start the timer you will need to record the cell that you are recording the timer in, the previous duration and the current timestamp.
When you stop the timer you will then need to update the correct cell with the previous duration + the time between now and when the timer was started.
VB Code:
Option Explicit
Dim MySheet As String
Dim MyColumn As Integer
Dim MyRow As Integer
Dim MyDuration As Double
Dim MyStart As Date
Sub Start_timer()
MySheet = ActiveSheet.Name
MyRow = ActiveCell.Row
MyColumn = 12 'Assuming this is the column where your storing the duration
MyDuration = Worksheets(MySheet).Cells(MyRow, MyColumn)
MyStart = Now()
End Sub
Sub Stop_timer()
Worksheets(MySheet).Cells(MyRow, MyColumn) = MyDuration + (Now() - MyStart)
End Sub
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Sep 13th, 2005, 02:12 PM
#4
Thread Starter
New Member
Re: Non VB user needs Excel help
This is for a specific workbook that I have setup to track projects at a help desk job. We are using Excel 2003. Ideally I would like it to manage multiple jobs at once, but I woulod be happy with one at a time.
Currently this is how it is setup.
Column A is start time using (Shift+CTRL+
Column B is end time using (Shift+CTRL+
Columns C, D, E are validation lists that drop down catagories of work sequentially.
Column F subtracts the end time from the start time and multiplies by 1440 and that gives me the minutes.
The problem is that I have to start a new row everytime I want to track a job, but that is not required by the company. I want to simply add time to the existing row with out having to manually calculte.
Does that make sense?
-
Sep 13th, 2005, 02:15 PM
#5
Re: Non VB user needs Excel help
 Originally Posted by mayakovski
I want to simply add time to the existing row with out having to manually calculte.
This is not possibe with your current structure of SartTime and EndTime columns.
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Sep 13th, 2005, 02:19 PM
#6
Thread Starter
New Member
Re: Non VB user needs Excel help
This is not possibe with your current structure of SartTime and EndTime columns.
OK;
I am not attached to that layout, that is just waht I have right now. How do I change it to work?
-
Sep 13th, 2005, 02:22 PM
#7
Re: Non VB user needs Excel help
Why not contiune to add records to the existing table and calculation the duration for that specific task/piece of work.
Then you could just creat a PivotTable to sum the various individual entry durations to get a total duration for each project.
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Sep 13th, 2005, 02:34 PM
#8
Thread Starter
New Member
Re: Non VB user needs Excel help
Why not contiune to add records to the existing table and calculation the duration for that specific task/piece of work.
Hmm, that would work though having a start and stop button that could continue from where it left off would be simpler to use, as I would not be recreating the job multiple times each day.
-
Sep 13th, 2005, 02:40 PM
#9
Re: Non VB user needs Excel help
 Originally Posted by mayakovski
....as I would not be recreating the job multiple times each day.
You don't need to recreate the job, just adding a new time block to that job.
You need to think of the JOB object and the TIMEBLOCK object as seperate.
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|