Posts by haixingau

    It's done with a scanner.... If you look at my form in my test file.

    Scan in Job number(barcode)

    Scan in Emp ID (barcode) ...

    Click on Time in ...

    Once Job is finished...

    Scan in Job number(barcode)

    Scan in Emp ID (barcode) ...

    Click on Time Out ...

    This Copy and move to another sheet...

    So i can have the same job/emp id repeat the task on the same day (multiple session).

    Kind regards

    Hi All,

    I have a Jobtime sheet1 with four column Job No. and Emp ID and Time in and Time out.

    I want to move/transfer Job No. and Emp ID and Time in and Time out (Job No. and Emp ID and Time in and Time out if all value exist) from sheet 1

    to sheet 2 and remove the value from sheet 1 also shift cell up(or remove row)

    If Time out value is not present then don't move/transfer.

    Hi All,

    Please help me with vba code for cut paste value from Jobtime sheet all row with condition that (both time in and out are complete) to Timesheet and leave the row with time out not finish alone.

    Kind regards

    Please help me with coding for time out portion. I need to code it so it would find and match value for Job Id and EmployID and time out..... Also need multiple session for identical Job ID and employID.

    Option Explicit

    Private Sub cmdTimein_Click()

    Dim iRow As Long

    Dim ws As Worksheet

    Set ws = Worksheets("JobTime")

    '''find first empty row in database

    ''iRow = ws.Cells(Rows.Count, 1) _

    '' .End(xlUp).Offset(1, 0).Row

    'revised code to avoid problems with Excel tables in newer versions

    iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _

    SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1

    'check for a part number

    If Trim(Me.EmpID.Value) = "" Then


    MsgBox "Please enter a Employee ID"

    Exit Sub

    End If

    'copy the data to the database

    ws.Cells(iRow, 1).Value = Me.EmpID.Value

    ws.Cells(iRow, 2).Value = Me.JobNo.Value

    ws.Cells(iRow, 3).Value = Now

    ws.Cells(iRow, 6).Value = Date

    'clear the data

    Me.EmpID.Value = ""

    Me.JobNo.Value = ""


    End Sub

    Private Sub cmdTimeout_Click()

    Dim lRow As Long

    Dim ws As Worksheet

    Dim Emp

    Dim MatchRow As String

    Dim SearchTable As Range

    Set SearchTable = Sheets("JobTime").Range("A2:A" & Sheets("JobTime").Range("A" & Rows.Count).End(xlUp).Row)

    Set ws = Worksheets("JobTime")

    Application.ScreenUpdating = False

    With Sheets("JobTime")

    If EmpID = "" Then

    MsgBox "Please Scan your ID", vbCritical, "Alert"


    If JobNo.Value = "" Then

    MsgBox "Please Select an Job Number.", vbCritical, "Alert"


    MatchRow = Application.WorksheetFunction.Match(JobNo.Value, .Range(SearchTable.Address), 0) + 1

    .Cells(MatchRow, 3).Value = Now

    End If

    'Clear userform

    JobNo.Value = vbNullString


    Application.ScreenUpdating = True

    End If

    End With

    End Sub