Results 1 to 17 of 17

userfrom consist of 3 list box to insert attendance for employee

Threaded View

mazan2010 userfrom consist of 3 list... 07-17-2017, 06:26 PM
gmr4evr1 Re: userfrom consist of 3... 07-17-2017, 07:19 PM
mazan2010 Re: userfrom consist of 3... 07-18-2017, 11:02 AM
mazan2010 Re: userfrom consist of 3... 07-17-2017, 07:21 PM
mazan2010 Re: userfrom consist of 3... 07-17-2017, 07:23 PM
mazan2010 Re: userfrom consist of 3... 07-17-2017, 07:25 PM
gmr4evr1 Re: userfrom consist of 3... 07-17-2017, 07:33 PM
LeoTaxi Re: userfrom consist of 3... 07-17-2017, 07:56 PM
mazan2010 Re: userfrom consist of 3... 07-18-2017, 11:00 AM
mazan2010 Re: userfrom consist of 3... 07-18-2017, 11:11 AM
gmr4evr1 Re: userfrom consist of 3... 07-18-2017, 08:00 AM
mazan2010 Re: userfrom consist of 3... 07-18-2017, 11:18 AM
LeoTaxi Re: userfrom consist of 3... 07-18-2017, 07:40 PM
mazan2010 Re: userfrom consist of 3... 07-19-2017, 12:35 PM
mazan2010 Re: userfrom consist of 3... 07-19-2017, 01:20 PM
LeoTaxi Re: userfrom consist of 3... 07-19-2017, 07:30 PM
LeoTaxi Re: userfrom consist of 3... 07-20-2017, 05:08 AM
  1. #17
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: userfrom consist of 3 list box to insert attendance for employee

    In this with extra option to choose new date

    Private Sub CommandButton2_Click()
    If Not IsDate(TextBox1) Then
        MsgBox "No valid date"
        TextBox1 = ""
        TextBox1.SetFocus
        Exit Sub
    Else
        Dim mydate As Double
        mydate = DateValue(TextBox1)
        With Sheets("Attendance")
            mycol = Application.Match(mydate, .Range("A8", "XFD8"), 0)
            If IsError(mycol) Then
                mycol = .Cells(8, .Columns.Count).End(xlToLeft).Offset(, 1).Column
                .Cells(8, mycol) = mydate
            End If
        End With
    End If
    
    With Sheets("Attendance")
        lr = .Range("A" & Rows.Count).End(xlUp).Row
        at = Application.CountA(.Range(.Cells(9, mycol), .Cells(lr, mycol)))
        If at > 0 Then
    vervolg:
            j = InputBox("1 = Cancel" & Chr(13) & "2 = Replace excisting data by new" & Chr(13) & "3 = Choose New Date", "Already data present for this date")
        End If
        If j = 1 Then
            Unload Me
            Exit Sub
        ElseIf j = 2 Then
        For i = 0 To UserForm1.ListBox1.ListCount - 1
            myrow = Application.Match(UserForm1.ListBox1.List(i), .Range("A:A"), 0)
            If Not IsError(myrow) Then .Cells(myrow, mycol) = "Present"
        Next
        For i = 0 To UserForm1.ListBox2.ListCount - 1
            myrow = Application.Match(UserForm1.ListBox2.List(i), .Range("A:A"), 0)
            If Not IsError(myrow) Then .Cells(myrow, mycol) = "Absent"
        Next
        For i = 0 To UserForm1.ListBox3.ListCount - 1
            myrow = Application.Match(UserForm1.ListBox3.List(i), .Range("A:A"), 0)
            If Not IsError(myrow) Then .Cells(myrow, mycol) = "Present other"
        Next
        ElseIf j = 3 Then
            TextBox1 = ""
            TextBox1.SetFocus
            Exit Sub
        Else
            GoTo vervolg
        End If
    End With
    Unload Me
    End Sub
    Kind regards
    Leo
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Employee Attendance Tracker Help :)
    By Block118 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-18-2017, 06:48 AM
  2. Employee Attendance help please
    By fredek in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-22-2016, 12:06 PM
  3. [SOLVED] Employee Attendance Template
    By mcanny in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-18-2016, 01:07 PM
  4. Track Employee Attendance
    By maabbas in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-17-2015, 08:17 AM
  5. Need Help - AutoCalculate Attendance Points for employee attendance records
    By switzd0d in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-17-2015, 03:00 PM
  6. Employee Attendance Record
    By PurpleMe in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-23-2013, 02:15 AM
  7. employee attendance
    By ruth in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-08-2005, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1