Dear Leo
i found your code work good but i note two problem
first when i press add attendance to sheet its add data even the textbox for date is empty and when i press again its the same data to next column and soon without look to corresponding date
also when i press button transfer from is also work good from present list to absent but if i want to return it again its remove the data from list box without return it


Quote Originally Posted by LeoTaxi View Post
Made listbox1 multi select, so first select all items


Private Sub CommandButton1_Click()
Dim i As Integer, j As Integer, jj As Integer
ReDim arr(1 To ListBox1.ListCount)
ReDim arr2(1 To ListBox1.ListCount)

For i = 0 To ListBox1.ListCount - 1
    If ListBox1.Selected(i) Then
        j = j + 1
        arr(j) = ListBox1.List(i)
    Else
        jj = jj + 1
        arr2(jj) = ListBox1.List(i)
    End If
Next
ListBox1.Clear
ListBox1.List = arr2
ListBox2.List = arr
End Sub

Private Sub CommandButton2_Click()
With Sheets("Attendance")
    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, .Columns.Count).End(xlToLeft).Offset(, 1) = "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, .Columns.Count).End(xlToLeft).Offset(, 1) = "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, .Columns.Count).End(xlToLeft).Offset(, 1) = "Present other"
    Next
End With
End Sub

Private Sub CommandButton3_Click()
Dim i As Integer
ReDim arr(1 To ListBox1.ListCount)
ReDim arr2(1 To ListBox1.ListCount)

For i = 0 To ListBox1.ListCount - 1
    If ListBox1.Selected(i) Then
        j = j + 1
        arr(j) = ListBox1.List(i)
    Else
        jj = jj + 1
        arr2(jj) = ListBox1.List(i)
    End If
Next
ListBox1.Clear
ListBox1.List = arr2
ListBox3.List = arr
End Sub
Kind regards
Leo