Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Time Clock - Making sure they clock out
Hi,
I currently have a macro running a time clock like function utalizing Excel and I was wondering, is there any way to make it so when a worker hits the start button for starting a new job, the computer checks to be sure that their time was entered for ending the previous job? If it wasn't ended, I was hoping it could insert the current time into the end of the previous job before going through the macro starting the new one. Thanks for the help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Time Clock - Making sure they clock out
My current code for the start button is:
Sub TimeStampStart() Const TimeStampColumn As String = "D" Const PWORD As String = "" ActiveSheet.Unprotect PWORD Dim X As Long Dim LastUsedRow As Long With ActiveSheet LastUsedRow = .Cells(Rows.Count, TimeStampColumn).End(xlUp).Row .Cells(LastUsedRow - (.Cells(LastUsedRow, TimeStampColumn). _ Value < ""), TimeStampColumn).Value = Now End With Const DateStampColumn As String = "A" Dim Y As Long Dim LastUnusedRow As Long With ActiveSheet LastUnusedRow = .Cells(Rows.Count, DateStampColumn).End(xlUp).Row If .Cells(LastUnusedRow, DateStampColumn).Value < "" Then LastUnusedRow = LastUnusedRow + 1 End If .Cells(LastUnusedRow, DateStampColumn).Value = Date .Cells(LastUnusedRow, TimeStampColumn).Value = Time End With ActiveSheet.Protect PWORD ActiveWorkbook.Save End Sub I hope this might help answer my question. I was thinking some sort of if statement in the early part to check if there is something in the end column ( column F) and if there isn't, insert the current time in there, than proceed onward. Is there a way to do that? Thanks for any and all help you can offer. "valiant" wrote: Hi, I currently have a macro running a time clock like function utalizing Excel and I was wondering, is there any way to make it so when a worker hits the start button for starting a new job, the computer checks to be sure that their time was entered for ending the previous job? If it wasn't ended, I was hoping it could insert the current time into the end of the previous job before going through the macro starting the new one. Thanks for the help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Incremental time values based upon clock in and clock out times | Excel Discussion (Misc queries) | |||
How do I calculate time in excel (clock in and clock out | Excel Discussion (Misc queries) | |||
Change EXCEL Clock to Standard Clock or Military Time | Excel Worksheet Functions | |||
Start Clock/Stop Clock | Excel Discussion (Misc queries) | |||
Time Clock | Excel Programming |