LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Time tracking


I'm currently trying to create a VB code that can make a time tracking
sheet like this:

Start time - End time - Total time worked - Worker - Project - Date

All time values should be hh:mm:ss
Worker should be a value of 1 to 5 and project from 1 to 5.

I also whant to have each worker to have a short cutt like "Ctrl +A"
for project 1 and same worker has "Ctrl +S" for project 2 and so on.

Below is my work so far. (Start time - end time - total time - Date)
Working

Private Sub CommandButton1_Click()
Dim rgTimeInCell As Range, rgTimeOutCell As Range, rgWorked As Range
Dim r As Long

If Range("E1") = "" Then Range("E1") = Format(Date, "mmmm d, yyyy")
'Put date in cell E1 if empty
With ActiveSheet.PageSetup 'Put date in left footer if it is
empty
If .LeftFooter = "" Then .LeftFooter = Format(Date, "mmmm d,
yyyy")
End With
Set rgTimeInCell = Range("A65536").End(xlUp)
If Application.CountA(Range(rgTimeInCell, rgTimeInCell.Offset(0, 2))) =
3 Then _
Set rgTimeInCell = rgTimeInCell.Offset(1, 0) 'Go to the next row
Set rgTimeOutCell = rgTimeInCell.Offset(0, 1)
Set rgWorked = rgTimeInCell.Offset(0, 2)

If rgTimeInCell = 0 Then 'enter time in
rgTimeInCell = Now()
rgTimeInCell.NumberFormat = "hh:mm:ss"
Else 'time out
rgTimeOutCell = Now()
rgTimeOutCell.NumberFormat = "hh:mm:ss"
rgWorked.FormulaR1C1 = "=RoundUp(24 * Abs(RC[-1] - RC[-2]), 1)"
rgWorked = Application.Text((rgTimeOutCell - rgTimeInCell),
"h:mm:ss")
rgWorked.NumberFormat = "hh:mm:ss"
End If
End Sub

Can someone help me with the rest?

Regards


--
frohanss
------------------------------------------------------------------------
frohanss's Profile: http://www.excelforum.com/member.php...o&userid=26917
View this thread: http://www.excelforum.com/showthread...hreadid=490040

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
tracking time FSt1 Excel Discussion (Misc queries) 4 December 12th 09 02:06 AM
Time Tracking Help Sri Excel Discussion (Misc queries) 0 April 1st 08 01:38 PM
Tracking Time CCS Excel Worksheet Functions 1 July 12th 06 12:27 AM
Tracking Time brucek Excel Discussion (Misc queries) 1 March 22nd 06 09:16 PM
Tracking time Hans Peter Excel Worksheet Functions 1 March 18th 06 08:07 PM


All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"