1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Dim element_select As Boolean
Dim nb_element, i As Integer
Dim dest As Range
Dim num As Integer
element_select = False
nb_element = ListBox2.ListCount
ligne = 5
With Worksheets("ARCHIVE CONGES")
For i = 0 To nb_element - 1
If ListBox2.Selected(i) = True Then
element_select = True
Set dest = IIf(.Range("A5").Value = "", .Range("A5"), .Cells(Application.Rows.Count, 1).End(xlUp).Offset(1, 0))
dest.Value = ListBox2.List(i, 0)
dest.Offset(0, 1) = ListBox2.List(i, 1)
dest.Offset(0, 2) = ListBox2.List(i, 2)
dest.Offset(0, 3) = ListBox2.List(i, 3)
dest.Offset(0, 4) = ListBox2.List(i, 4)
dest.Offset(0, 5) = ListBox2.List(i, 5)
MsgBox "Congés validés"
End If
Next
If element_select = False Then
MsgBox "vous n'avez rien selectionné"
End If
End With
End Sub |
Partager