• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Help on time stamp

Hello,

From the attached file I capture transaction start & end time and Break start & end time.

I am looking for below conditions while capturing the time stamp

1>Without starting a job its end time should not be captured. Similarly without ending the current job the next job should not capture.

2>Break would come in between a job, just like above condition without starting the job break start/end time should not be captured.

3> if there is job start time is captured in A5 and If there is a break start time it should be captured in B5 only and end time in C5. Currently its capturing the breaks to the next empty cell in column B and C.

This would help me to analyse actual job timings excluding breaks for that job.

thanks in advance for your help.
 

Attachments

  • Time stamp (2).xlsm
    21.6 KB · Views: 5
Try attached file.
Thanks for your response Deepak.

From your attachment all the conditions are working fine.

But if job start time is captured and it should allow to end the job. but here without break start and end time the job end is not working.

Hence job end should work without break time. next job may have break start and end time.
 
Hi Deepak,

I need your help again. I am sorry may be I was not clear above in explaining the condition,

If break is started it should end and if break is not ended the job should not end.

Here I am able to end the job without ending the break first.
 
Change Sub EndTime() to as below!!
Code:
Sub EndTime()
Dim l As Long
l = Range("D" & Rows.Count).End(xlUp).Row

If l < 3 Then
    ActiveSheet.Cells(3, 4) = Now
Else
    If Cells(l + 1, 1) = "" Then
        MsgBox "Not Allowed", vbCritical
    ElseIf Cells(l + 1, 2) <> "" And Cells(l + 1, 3) = "" Then
        MsgBox "Not Allowed", vbCritical
    Else
        Cells(l + 1, 4) = Now
    End If
End If
End Sub
 
Back
Top